Page 1 of 1

Sorting elements within one level of hierarchy

Posted: Tue Aug 17, 2021 2:30 pm
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?

Re: Sorting elements within one level of hierarchy

Posted: Wed Aug 18, 2021 9:51 am
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

Re: Sorting elements within one level of hierarchy

Posted: Wed Aug 18, 2021 1:18 pm
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.