Hi All,
I have to create a subset which shows my product dimension hierarchy in a alphabetic order.
The product dimenions looks basically like this:
total
-c
--ad
--cf
--bd
-a
--ed
--af
My subset has to reflect the hierarchy but in a alphabetical order in each level. Like this....
total
-a
--af
--ed
-c
--ad
--bd
--cf
Any ideas?
Dynamic subset hierarchy sort ascendic hierarchy
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: Dynamic subset hierarchy sort ascendic hierarchy
Can't do it. If you want the hierarchy to be sorted like that in a subset then the dimension itself will already need to be sorted like that to begin with. Just change the sort order properties in the }DimensionProperties cube and rebuild the dimension (or rebuild with an XDI sheet).maps wrote:Any ideas?
-
- Posts: 12
- Joined: Fri Apr 12, 2013 1:28 pm
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: 2003 - 2010
Re: Dynamic subset hierarchy sort ascendic hierarchy
What seems to work for me is attaching the following MDX expression to the subset:
{ORDER({TM1SUBSETALL( [Products] )}, MemberToStr([Products].CurrentMember), ASC)}
This may not work in all circumstances but is perhaps worth a try.
{ORDER({TM1SUBSETALL( [Products] )}, MemberToStr([Products].CurrentMember), ASC)}
This may not work in all circumstances but is perhaps worth a try.
-
- Posts: 15
- Joined: Wed Sep 04, 2013 2:26 pm
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: Excel 2010
Re: Dynamic subset hierarchy sort ascendic hierarchy
Sorry to open this old Thread,
the mdx-expression is working, but somehow it sorts the elemnts from this:
total
-c
--ad
--cf
--bd
-a
--ed
--af
to this
a
-af
-ed
c
-ad
-bd
-cf
total
Any ideas? :/
the mdx-expression is working, but somehow it sorts the elemnts from this:
total
-c
--ad
--cf
--bd
-a
--ed
--af
to this
a
-af
-ed
c
-ad
-bd
-cf
total
Any ideas? :/
-
- Posts: 48
- Joined: Thu Nov 19, 2009 10:38 pm
- OLAP Product: Tm1
- Version: 10.2.2
- Excel Version: 2010
Re: Dynamic subset hierarchy sort ascendic hierarchy
There is a way achieve the sort using ELPAR in this example - but it may not work well where the parent index is different for the children that sit under a particular hierarchy.
In this case the parent index is the same (ie 1) for all the children - so the sort can be done in 3 steps.
1. Create attribute for the dimension
- call it sortName for example
2. Create a rule on the }ElementAttributes cube for the dimension
- the rule will be:
['sorName'] = S:
IF (DTYPE('dimName', !dimName) @='N',
ELPAR('dimName', !dimName, 1) | '-' | !dimName ,
!dimName);
this will concatenate the parent name with the element name - thereby giving a alphabetical (or alpha-numeric) list that can be sorted.
3. Create an MDX that sorts using the attribute with a drilldown on the consolidation member (in this case total)
- the expression will be
{ ORDER( {TM1DRILLDOWNMEMBER( {[dimName].[total]}, ALL, RECURSIVE )} , [dimName].[sortName], ASC) }
You can try/tweak this approach on other hierarchies and see how you go.
In this case the parent index is the same (ie 1) for all the children - so the sort can be done in 3 steps.
1. Create attribute for the dimension
- call it sortName for example
2. Create a rule on the }ElementAttributes cube for the dimension
- the rule will be:
['sorName'] = S:
IF (DTYPE('dimName', !dimName) @='N',
ELPAR('dimName', !dimName, 1) | '-' | !dimName ,
!dimName);
this will concatenate the parent name with the element name - thereby giving a alphabetical (or alpha-numeric) list that can be sorted.
3. Create an MDX that sorts using the attribute with a drilldown on the consolidation member (in this case total)
- the expression will be
{ ORDER( {TM1DRILLDOWNMEMBER( {[dimName].[total]}, ALL, RECURSIVE )} , [dimName].[sortName], ASC) }
You can try/tweak this approach on other hierarchies and see how you go.
J.Rizk
Tm1 for everyone
Tm1 for everyone
-
- Posts: 15
- Joined: Wed Sep 04, 2013 2:26 pm
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: Excel 2010
Re: Dynamic subset hierarchy sort ascendic hierarchy
Hi jrizk,
thank you for your approach.
I somehow solved it myself with the following MDX-Expression.
Regards
thank you for your approach.

I somehow solved it myself with the following MDX-Expression.
Regards
Code: Select all
UNION(
{[<Dimension>].[total]},
{
ORDER(
{
{TM1DRILLDOWNMEMBER( {TM1SubsetBasis()}, ALL, RECURSIVE )}
}
, MemberToStr([<Dimension>].CurrentMember), ASC)}
)