Before I created a hierarchy in my dimension the MDX to sort by attribute worked perfectly. I have since created a structure in the dimension and the sort is now being applied to each area of the hierarchy individually. What I need to be able to do is show only the leaf level elements and then sort those by the attribute (so in effect what it did before the hierarchy was created). Is there a way to sort N level elements irresepctive of their parent?
Please see attached document demonstrating the issue.
Sorting hierarchy by an attribute
-
- Posts: 19
- Joined: Wed Sep 28, 2016 1:43 pm
- OLAP Product: Cognos TM1
- Version: 10.1.1
- Excel Version: 2007
Sorting hierarchy by an attribute
- Attachments
-
- TM1 Sort Issue.docx
- (34.86 KiB) Downloaded 475 times
-
- MVP
- Posts: 3240
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.1.5
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: Sorting hierarchy by an attribute
Your screenshots do not match the explanation/code.
If you filter by level 0, how can you have consolidated elements in the subset ?
Otherwise your screenshots are misleading and it will not be easy to help you.
If you filter by level 0, how can you have consolidated elements in the subset ?
Otherwise your screenshots are misleading and it will not be easy to help you.
Best regards,
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- Posts: 19
- Joined: Wed Sep 28, 2016 1:43 pm
- OLAP Product: Cognos TM1
- Version: 10.1.1
- Excel Version: 2007
Re: Sorting hierarchy by an attribute
I just showed the hierarchy screenshot just to show how it is sorting within each hierarchy rather than ignoring them.Wim Gielis wrote:Your screenshots do not match the explanation/code.
If you filter by level 0, how can you have consolidated elements in the subset ?
Otherwise your screenshots are misleading and it will not be easy to help you.
So you can see in the first example "Advisor" has a sort order of 99 and "Admin Support" has a sort order of 0, so in the first screenshot which is the order the MDX is generating, "Advisor" should be at the bottom as 99 is the highest number and "Admin Support" should be at the top. Within the "Other parent" it is sorting in the sort order attribute correctly but it is doing it within each parent, not on the leafs as a whole.
- gtonkin
- MVP
- Posts: 1265
- Joined: Thu May 06, 2010 3:03 pm
- OLAP Product: TM1
- Version: Latest and greatest
- Excel Version: Office 365 64-bit
- Location: JHB, South Africa
- Contact:
Re: Sorting hierarchy by an attribute
Try BASC at the end of your ORDER function instead of ASC.
-
- Posts: 19
- Joined: Wed Sep 28, 2016 1:43 pm
- OLAP Product: Cognos TM1
- Version: 10.1.1
- Excel Version: 2007
Re: Sorting hierarchy by an attribute
Perfect! Thanks very much.gtonkin wrote:Try BASC at the end of your ORDER function instead of ASC.