By "duplicates within a consolidation" I assume you mean ultimate descendants of a rollup appearing multiple times and not direct children?
This is the standard MDX snippet I use for this purpose. It will work for the example you gave and return a set of e,f,g for the rollup a
Code: Select all
{FILTER(
{TM1FilterByLevel( TM1SubsetAll( [Dimension] ), 0 )},
COUNT( {INTERSECT({Descendants([Dimension].[Rollup],10,LEAVES)}, {[Dimension].CurrentMember}, ALL )} ) > 1
)}
Note that this will be slow for any "large" dimension as MDX simply doesn't perform that great over large sets. (By "large" I mean any dimension with say > 5000 elements). For larger dimensions I usually use TI not MDX as the MDX could take several minutes for a large dimension whereas TI will be seconds.
Also obviously the MDX just counts duplicates in the rollup and doesn't take element weighting into account. For (admittedly rarer) cases where an element might appear multiple times but the net weighted contribution to the rollup is still 1 then the MDX would give incorrect results, but this would depend on how you define what is a "duplicate".
And for the inverse purpose to find elements which haven't been allocated a parent at all in the rollup. From your example this would return a set of the element c.
Code: Select all
{FILTER(
{TM1FilterByLevel( TM1SubsetAll( [Dimension] ), 0 )},
COUNT( {INTERSECT({Descendants([Dimension].[Rollup],10,LEAVES)}, {[Dimension].CurrentMember}, ALL )} ) = 0
)}
Admin : Edited to correct missing bracket in MDX