Page 1 of 1

MDX Dimension order

Posted: Fri Jul 22, 2022 10:09 am
by DYNA
Good Day Everyone,

Apologies if I am asking a basic question. I may be trying to accomplish something that is not possible.

I have a dimension with multiple consolidated level,

Dimension Structure

-OTHER
-Project
-account
-Other account


The OTHER level is the top level followed by a project, account is the leaf level, and other account is the leaf level under the OTHER level.

I'm trying to display the other account at the top of the Project consolidated level using MDX expression.

Please note that there are multiple levels like project.

Thank you in advance

Re: MDX Dimension order

Posted: Fri Jul 22, 2022 10:44 am
by MarenC
Hi,

I would create a text attribute called something like sortorder, and then use this to order by. The Mdx would then be:

ORDER({TM1SUBSETALL( [dimension name] )}, VAL([dimension name].currentmember.properties("Sortorder")) )

The sort order values would be 1 through to n number of elements in dimension, so your first elements sort order would be 1 etc

Maren

Re: MDX Dimension order

Posted: Fri Jul 22, 2022 7:06 pm
by burnstripe
{Union({[dimname].[other],{tm1filterbylevel({[dimname].[other].children},0)}}
, {tm1drilldownmember({[dimname].[other]}, all, recursive)}
)}

This could also do the trick without any attributes/indexes, hopefully there's no typos as I'm not at a pc currently to test.