MDX Expression : Dynamic Subset ( all leaf level elements of multiple consolidated elements of a Dimension)

Post Reply
SBK88
Posts: 45
Joined: Fri Apr 17, 2015 5:55 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2013

MDX Expression : Dynamic Subset ( all leaf level elements of multiple consolidated elements of a Dimension)

Post by SBK88 »

Hi Guyzzz,
Need help
I have a Dimension : DIM with say 10 level Hierarchy.
Have few elements at level ( say 4,5 or 6 any level except the top and leaf level) : AAA, BBB, CCC, DDD, EEE
My requirement is to create a Subset : SUB of Dimension : DIM with all the leaf level elements under these parent elements (AAA, BBB, CCC, DDD)

then will use this subset to create a datasource view for a TI process.

Currently I am using, code like this -
cDimName = 'DIM' ;
cConsol = 'AAA' ;
ExecuteProcess('Bedrock.Dim.Sub.Create.Consolidation.Leaf',
'pDimension', cDimName,
'pSubset', cSubset,
'pConsol', cConsol,
'pAddtoSubset', 0,
'pExclusions', 'Other',
'pDelimiter', '&',
'pDebug', pDebug
) ;[
/i]


problem with this code is, I can only create a subset for a single parent out of(AAA, BBB, CCC, DDD)
Need a dynamic subset for this.
Can you help me with the required MDX Expression.




Thnaks,
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: MDX Expression : Dynamic Subset ( all leaf level elements of multiple consolidated elements of a Dimension)

Post by declanr »

Not sure what the bedrock process actually does; it could be either using MDX or might just perform a while loop so I will ignore bedrock for this.

The MDX however can be done in many ways; one of the simplest is something like:

Code: Select all

{TM1FilterByLevel(
	{TM1DrillDownMember(
		{[DIM_NAME].[Element1]} + {[DIM_NAME].[Element2]} + ... + {[DIM_NAME].[ElementX]},
		ALL, RECURSIVE)
	},
	0)	
}
And it depends what your actual requirement is but I would be tempted to use a base subset for the initial list of consolidated elements:

Code: Select all

{TM1FilterByLevel(
	{TM1DrillDownMember(
		{[DIM_NAME].[Base_Subset_Name]},
		ALL, RECURSIVE)
	},
	0)	
}
Then your base subset can either be a static list or can itself be MDX that is maintained by whether or not an attribute is populated etc.
Declan Rodger
SBK88
Posts: 45
Joined: Fri Apr 17, 2015 5:55 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2013

Re: MDX Expression : Dynamic Subset ( all leaf level elements of multiple consolidated elements of a Dimension)

Post by SBK88 »

Thanks Bro
Post Reply