Page 1 of 1

Dynamics Subsets in multi Hierarchy Dimension

Posted: Thu Mar 28, 2013 9:27 am
by Armonds
I have Dimension:
Group1
Elem1 (attribute: H1)
Elem2 (attribute: H1)
Group2 (attribute: H1)
Elem3 (attribute: H1)
Elem4 (attribute: H1)

I need to create dynamic subset sorted by hierarchy. I generated expression:

Code: Select all

HIERARCHIZE( {FILTER( {TM1SUBSETALL([TestDim])}, [TestDim].[Hierarchy] = "H1")} ) }
but after executing it the result is sorted by index nod by hierarchy:
Elem1 (attribute: H1)
Elem2 (attribute: H1)
Group2 (attribute: H1)
Elem3 (attribute: H1)
Elem4 (attribute: H1)

If I manually in subset editor filter by attribute H1 and press Hierarchy sort button, it sorts elements as I need it:
Group2 (attribute: H1)
Elem1 (attribute: H1)
Elem2 (attribute: H1)
Elem3 (attribute: H1)
Elem4 (attribute: H1)

How to correct dynamic subset expression?

Re: Dynamics Subsets in multi Hierarchy Dimension

Posted: Thu Mar 28, 2013 10:38 am
by mvaspal
Hi
but after executing it the result is sorted by index nod by hierarchy
Actually, at the same time this is also a hierarchical sort.
I have just quickly created a dimension with the elements and order:
Elem1
Elem2
Group2
Elem3
Elem4

If you sort this dimension hierarchically, you will still get the same result. I don't think hierarchy sort puts cons elements before orphan N elements if these N elements are before the cons elements in the dimension sort order.

Re: Dynamics Subsets in multi Hierarchy Dimension

Posted: Thu Mar 28, 2013 11:23 am
by Armonds
made some screens:
1. all elements
Image
2. expression output
Image
3. manually filtered and pressed hierarchy sort
Image

Re: Dynamics Subsets in multi Hierarchy Dimension

Posted: Thu Mar 28, 2013 11:39 am
by mvaspal
Hi
Are you sure the first screen is after 'All' ? If Elem2 is child of both Group1 and Group2, then 'All' usually does not show it under both; only if you collapse and re-expand the second parent.

How is your dimension ordered? Manually? Can you also send a screen from your dimension editor directly after opening it?

Re: Dynamics Subsets in multi Hierarchy Dimension

Posted: Thu Mar 28, 2013 11:49 am
by Armonds
Yes, You right, i expanded second group.

Image

Re: Dynamics Subsets in multi Hierarchy Dimension

Posted: Thu Mar 28, 2013 11:58 am
by mvaspal
The really interesting is that when you choose record expression, then do the filtering manually and then save the expression, it looks good. And then when you reopen it, the hierarchical structure gets lost

Re: Dynamics Subsets in multi Hierarchy Dimension

Posted: Thu Mar 28, 2013 12:02 pm
by Armonds
Yes, and I'm stuck at this. As alternative I think I will made static subset with TI process.

Re: Dynamics Subsets in multi Hierarchy Dimension

Posted: Thu Mar 28, 2013 12:06 pm
by mvaspal
it seems that it first creates the hierarchy order (in which elem2 and elem3 is before Group2) and then filters the elements, even if the filter expression is within the Hierarchize expression