Page 1 of 1

Nested MDX Statement

Posted: Wed Mar 02, 2011 10:13 pm
by AuctionTM1
I'm trying to create a nested MDX statement in order to sort a subset by the cell values from two elements. Here are the individual MDX statements I created and both work great on their own. However, how do I combine these two so that the dimension is sorted by 'Auction Year' and then 'Auction Month'


{Order (
{ TM1FilterByLevel ( { ( [Location] . [Forecasted Auctions] . Children ) } , 0 ) }
, [Auction Forecast] . ( [GL Account] . [Auction Year] )
, ASC )}

{Order (
{ TM1FilterByLevel ( { ( [Location] . [Forecasted Auctions] . Children ) } , 0 ) }
, [Auction Forecast] . ( [GL Account] . [Auction Month] )
, ASC )}

Thanks

Re: Nested MDX Statement

Posted: Thu Mar 03, 2011 5:41 am
by Oratia623
I would create a new element [GL Account] . [Auction Year Month], and a rule that would combine [Auction Year] and [Auction Month].
eg if [Auction Year] = 2011 and [Auction Month] = 09, then [Auction Year Month] = 201109

Then use [Auction Year Month] in the MDX sorting.

Re: Nested MDX Statement

Posted: Thu Mar 03, 2011 6:48 pm
by AuctionTM1
It works great, thanks.