Hello,
I'm using SSAS 2005. I've got a fact table that stored two balances... begin balance and end balance. I've got an account code dimension that has a hierarchy of accounts. Everything work great until I try to implement a feature of certain accounts that are known as Elimination accounts. Essentially, when rolling up an elimination account the parent account ignores the balance of the elimination account and some other account subtracts the balance instead. Here is an example:
Account_A Account_A1 $10 Account_A2 $20 Account_B Account_B1 $1 Account_B2 $2 (Eliminates to Account_A2)
In the above example, Account_A would have a balance of $28. ($10 + $20 - $2) And Account_B would have a balance of $1.
Now in my cube I was able to create a Custom Member Formula for every parent that is affected by an Elimination account. (In the above example, both Account_A and Account_B would have a custom member formula.) Here is the idea behind the formula...
SUM( FILTER( [dimAccounts].[Account Hierarchy].&[1].Children, [dimAccounts].[Account Hierarchy].CurrentMember.Name <> '1'), [Measures].[Begin Balance]) - ([Measures].[Begin Balance], [dimAccounts].[Account Hierarchy].&[6])
Where &[1] would be Account_A and &[6] woudl be Account_B2.
The idea is to sum all of the parent's children (excluding the child that is put there when using a 'Usage' of 'Parent' to build the hierarchy) and then subtract out the balance in the elimination account. In my proof-of-concept cube, this worked out great. Then I added an ending balance to the fact table. (So I now have both a Begin Balance and an Ending Balance.) Well, my MDX formula specifically sums up the Begin Balance. How can I create an MDX statement that will work with both balances?
Thanks,
Scott