Page 1 of 1

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

Posted: Sat Nov 19, 2016 3:35 pm
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,

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

Posted: Sat Nov 19, 2016 3:58 pm
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.

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

Posted: Sat Nov 19, 2016 4:09 pm
by SBK88
Thanks Bro