|
|
Question : MDX, calculated member
|
|
Ok, I have (probably) a rather easy question, however, while I think SQL is easy, MDX always confuses me to death =(
What I have is : * a [Time] dimension (Year/Quarter/Month/Date) * a couple of [Measures] (ccyMTD, ccyYTD, lclMTD, lclYTD) * an [AccountCodes] structure (some other things... the ever-positive me hopes to be able to add those afterwards =)
What I need is : on the columns : the months (just for 1 year) so I guess something alike to "Descendants([Time].[2005], [Month])" ????? on the rows : the account_codes, so I guess something along "[AccountCodes].Children" ??
In the grid : the DIFFERENCE of each month versus the month before that for both ccyYTD and lclYTD => will probably need a two calculated members and a crossjoin but I can't get it to work =(
I guess this isn't all too difficult... whished there was an MDX crash-course for dummies somewhere =(
Remark : for January it would be nice to have one solution that calculates January vs December of the previous year, and one solution that compares to 0.00, so it actually returns the actuall amount of January itself
|
Answer : MDX, calculated member
|
|
sorry forgot to update query
with member [Measures].[Difference ccyYTD] as '(Time.CurrentMember, [Measures].[ccyYTD]) - (Time.CurrentMember.PrevMember, Measures.[ccyYTD])' member [Measures].[Difference lclYTD] as '(Time.CurrentMember, [Measures].[lclYTD]) - (Time.CurrentMember.PrevMember, Measures.[lclYTD])'
select CrossJoin({[Measures].[ccyYTD],[Measures].[Difference ccyYTD],[Measures].[lclYTD],[Measures].[Difference lclYTD]},{[AccountCodes].Children}) on columns, {Descendants([Time].[2005],[Time].[Month])} on rows from CubName
|
|
|
|
|