Subset: Sort by Element Name, Display Alias

Post Reply
winshent
Posts: 11
Joined: Fri Mar 07, 2014 10:48 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: O365
Location: London, UK

Subset: Sort by Element Name, Display Alias

Post by winshent »

I am trying to get my head around this (I'm still relatively new to TM1)..

My dimension is named GLT_Account, the subset is named All_Accounts. This subset contains the consolidation 'All_Accounts' and all of its N level elements.

For example
Premium Written Direct(10000)
Gross Premiums Written by 3rd Parties (10005)
Bad Debt Expense Premiums(10025)

I've built and MDX as below, which sorts the accounts by element name (10025 etc). However, I need to display the alias for users by default.

Code: Select all

{Union ({TM1FILTERBYPATTERN( {TM1SUBSETALL( [GLT_Account] )}, "All_Accounts")},
{TM1SORT( { EXCEPT( {TM1DRILLDOWNMEMBER( {TM1FILTERBYPATTERN( {TM1SUBSETALL( [GLT_Account] )}, "All_Accounts")}, ALL, RECURSIVE )}, { [GLT_Account].[All_Accounts] }) }, ASC)})}
I've tried executing this after saving the MDX. However, the result is the accounts sorted by alias.

Code: Select all

SubsetAliasSet ( 'GLT_Account' , 'All_Accounts', 'Description' ) ;


Have i approached this completely the wrong way ?
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Subset: Sort by Element Name, Display Alias

Post by tomok »

Pretty sure you can't sort in a subset by element name and then display alias because the sort is going to be based on whatever is displayed in the subset, not the underlying element names. If they are the same then great, if not, no can do. AFAIK, the only place you can do what you want is in an active form by hiding the element column and using a DBRA in another column and displaying that instead.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
gtonkin
MVP
Posts: 1259
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Subset: Sort by Element Name, Display Alias

Post by gtonkin »

Try this:

Code: Select all

UNION({[GLT_Account].[All_Accounts]},
ORDER({TM1DRILLDOWNMEMBER( {[GLT_Account].[All_Accounts]}, ALL, RECURSIVE )},[}ElementAttributes_GLT_Account].([GLT_Account].Currentmember),BASC))
It appeared from your previous MDX that you only have level 0 and 1 so did not include a filter on level.

p.s. Based on your SubsetAliasSet, your subset looks to be named the same as your C level/root element - probably not a good idea either.
BR, George.

Learn something new: MDX Views
winshent
Posts: 11
Joined: Fri Mar 07, 2014 10:48 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: O365
Location: London, UK

Re: Subset: Sort by Element Name, Display Alias

Post by winshent »

gtonkin wrote:Try this:

Code: Select all

UNION({[GLT_Account].[All_Accounts]},
ORDER({TM1DRILLDOWNMEMBER( {[GLT_Account].[All_Accounts]}, ALL, RECURSIVE )},[}ElementAttributes_GLT_Account].([GLT_Account].Currentmember),BASC))
It appeared from your previous MDX that you only have level 0 and 1 so did not include a filter on level.

p.s. Based on your SubsetAliasSet, your subset looks to be named the same as your C level/root element - probably not a good idea either.
Thanks gtonkin..

I've been on holiday, hence the late response..

I tried your MDX but it didn't appear to do any sorting of the elements... Did you record this or write the MDX ?
art83
Posts: 5
Joined: Thu Aug 21, 2014 4:09 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2007-2016

Re: Subset: Sort by Element Name, Display Alias

Post by art83 »

If I'm understanding you correctly, you should be able to sort by an attribute. In the example below, "Default" is an alias which is just equal to the element's name. You can then sort by this attribute while still displaying the "Description" alias as you desire.

Code: Select all

{UNION({[GLT_Account].[All_Accounts]},
ORDER( {TM1FILTERBYLEVEL( {Descendants([All_Accounts])}, 0)}, [GLT_Account].[Default], BASC)
)}
If this doesn't work, I think a picture of your dimension structure would help augment your description in your original post.
Post Reply