Sorting elements within one level of hierarchy

Post Reply
michalb
Posts: 18
Joined: Thu Dec 03, 2020 3:45 pm
OLAP Product: TM1
Version: 2.1
Excel Version: 2016

Sorting elements within one level of hierarchy

Post by michalb »

Hi,

I have just one hierarchy within dimension which looks more or less like this:
Total (level 3)
-Total Group 1 (level 2)
---A (level 1)
------x (level 0)
------y (level 0)
------z (level 0)
---B (level 1)
---C (level 1)
-Total Group 2 (level 2)
---D (level 1)
------q (level 0)
------w (level 0)
------e (level 0)
---E (level 1)
---F (level 1)
Elements of level 1 are strings that need to be sorted alphabetically. There will be more elements of level 1 in the future. Only elements of this level need to be sorted without destroying this hierarchy. Is it possible to do by creating MDX subset or I need to use Dimension Manipulation TurboIntegrator Functions?
lotsaram
MVP
Posts: 3703
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Sorting elements within one level of hierarchy

Post by lotsaram »

Only Level 1 need to be sorted alphabetically, but does it matter if Level 2 is also sorted alphabetically? (Same for Level 0). If so then the DimensionSortOrder function (or just manually applying the correct entry to the }DimensionProperties cube for the hierarchy in question) should be all that you need to solve your requirement. You want SORTCOMPONENTSTYPE=BYNAME, SORTCOMPONENTSSENSE=ASCENDING
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
michalb
Posts: 18
Joined: Thu Dec 03, 2020 3:45 pm
OLAP Product: TM1
Version: 2.1
Excel Version: 2016

Re: Sorting elements within one level of hierarchy

Post by michalb »

Thanks for the response, it solved my requirement. However, for whatever reason apllying it manually didn't work, DimensionSortOrder worked.
Next step would be to sort it by aliases - and I found solution here:
viewtopic.php?t=7122
using SwapAliasWithPrincipalName before DimensionSortOrder in Prolgue and then in Epilogue works brilantlly.

Unfortunatelly TM1 doesn't know how to sort letters that are not in english alphabet - even though I have Language parameter in tm1s.cfg set correctly to my language, it puts all the 'special' letters at the end of the hierarchy in a random order.
Post Reply