Page 1 of 1

Sort subset elements by an attribute

Posted: Sun May 09, 2010 11:35 pm
by JJ2
Hi Everyone,

I am new to TM1. I have a dimension with 4 levels. I would like to creat a subset using MDX to filter the dimension on the lowest level and then sort it by one of the dimension attributes. I would appreciate any help with the syntax for this.

Thanks!

Re: Sort subset elements by an attribute

Posted: Mon May 10, 2010 10:30 pm
by Oratia623
Here you go:
{ORDER( {TM1FILTERBYLEVEL( {TM1SUBSETALL( [dimensionname] )}, 0)}, [dimensionname].[attribute],ASC )}

Substitute your dimension name and attribute name.
The ASC at the end denotes ascending order, you can change this to DESC to sort in decending order.

Paul

Re: Sort subset elements by an attribute

Posted: Tue May 11, 2010 12:19 pm
by JJ2
Thanks Paul!