Page 1 of 1

Tm1RptRow - Mdx Expression with sorting on Alias

Posted: Sat Jun 10, 2017 1:29 pm
by chewza
Hi there

I have a Tm1RptRow expression with the mdx parameter.

Problem:
I need the rows returned by the Mdx to be sorted according to an ALIAS.
Using the Tm1Sort function in the mdx will sort according to the original elements - doesn't allow you to specify alias.

I know that in the Tm1RptRow function itself you can specify the alias you want to display. However, this doesn't help because I want the rows SORTED by the alias.

Any ideas?

Many thanks!
Chris

Re: Tm1RptRow - Mdx Expression with sorting on Alias

Posted: Sat Jun 10, 2017 2:40 pm
by declanr
You want to use the order function as you would with any attribute type.
Below is an example; you will want to look into the differences between ASC, BASC, DESC and BDESC to get the result you want.

Code: Select all

{Order({[DIM_NAME].members},[DIM_NAME].[ALIAS_NAME],ASC)}

Re: Tm1RptRow - Mdx Expression with sorting on Alias

Posted: Sat Jun 10, 2017 3:14 pm
by chewza
Brilliant - much appreciated!!!