Tm1RptRow - Mdx Expression with sorting on Alias

Post Reply
chewza
Posts: 147
Joined: Tue Aug 17, 2010 11:51 am
OLAP Product: TM1
Version: 9.5
Excel Version: 7

Tm1RptRow - Mdx Expression with sorting on Alias

Post 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
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Tm1RptRow - Mdx Expression with sorting on Alias

Post 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)}
Declan Rodger
chewza
Posts: 147
Joined: Tue Aug 17, 2010 11:51 am
OLAP Product: TM1
Version: 9.5
Excel Version: 7

Re: Tm1RptRow - Mdx Expression with sorting on Alias

Post by chewza »

Brilliant - much appreciated!!!
Post Reply