Monday, February 20, 2012

MDX multidimensional sum

Hi i m a new at mdx


i have a big problem with the sum

simple cube:

SET [Agreed Action List] as {

{(

[Agreed Action].[Description En].children

-- IF I Decomment the following line adding another level to the row hierarchy ... boom

--,{ [Trafficked Person].[Sex En].&[male],[Trafficked Person].[Sex En].&[female]}

)}

}

MEMBER [Agreed Action].[Description En].[sum] as

'Sum([Agreed Action List],[Measures].[TP Count])'

SELECT

NON EMPTY

{

[Agreed Action List],

[Agreed Action].[Description En].[sum]

}

ON ROWS,

NON EMPTY

{

[Case Opened Date].[year].&[2001],

[Case Opened Date].[year].&[2002]

}

*

{ [Measures].[TP Count]}

THIS WORK FANTASTIC, my grand total calc at the end gives the sum of the rows as expected but ..

if i add the commented line adding another level to the row hierarchy i got the error that the two set in rows have different dimensionality

which i understand, but how can i have a sum with the same dimensionality of the new [Agreed Action List] named set to

create the final grand total that i need ?

Thanks in advance

If you want [Agreed Action List] to contain tuples with dimensionality of 2, then you need to make sure that when you use your calculated member [Agreed Action].[Description En].[sum] in SELECT statement you put that member into a tuple with dimensionality of 2 as well. This way the dimensionalities match, and MDX will be processed successfully.

SELECT

NON EMPTY

{

[Agreed Action List],

( [Agreed Action].[Description En].[sum] , [Trafficked Person].[Sex En].&[male],[Trafficked Person].[Sex En].&[female] )

} ON ROWS

No comments:

Post a Comment