# Database Discussions > MDX and Analysis Services >  help on aggregation using lastchild

## Paulina

With the below iam trying to get the lastchild to work based on, i have two dimenstion on the second dimension i want only the last child where the account type is = asset the rest of account type i need the sum value

iif(([Ledger Date].CurrentMember.Level.Name = "Year" and [Ledger Entries].CurrentMember is [Ledger Entries].[Account Type].&[Asset]) ,[Ledger Date].CURRENTMEMBER.LASTCHILD, ([Ledger Date].CURRENTMEMBER, [Measures].[Value]))

----------

