Rank Measure

Post Reply
gdimit
Posts: 17
Joined: Tue Mar 22, 2011 10:15 am
OLAP Product: TM1
Version: 10.2.1
Excel Version: 2010

Rank Measure

Post by gdimit »

Hi all,

I want to create a measure that rank the members of a dimention based on a measure.

What I came so far is to create a measure for its member in which I compare the value of the member against the value of a another member. Finally I added the new measures.
For example lets assume that I have 5 members I create 5 measures with the following rules

['Dummy1']= if ( ['Measure'] >= DB('Cube',!Dim1, DIMNM('Dim2',1), 'Measure' ), 0, 1);
['Dummy2']= if ( ['Measure'] >= DB('Cube',!Dim1, DIMNM('Dim2',2), 'Measure' ), 0, 1);
['Dummy3']= if ( ['Measure'] >= DB('Cube',!Dim1, DIMNM('Dim2',3), 'Measure' ), 0, 1);
['Dummy4']= if ( ['Measure'] >= DB('Cube',!Dim1, DIMNM('Dim2',4), 'Measure' ), 0, 1);
['Dummy5']= if ( ['Measure'] >= DB('Cube',!Dim1, DIMNM('Dim2',5), 'Measure' ), 0, 1);
['Rank'] = ['Dummy1']+['Dummy2']+['Dummy3']+['Dummy4']+['Dummy5']

The above rules gave me the result that I expect but I was wondering if is there any other more sophisticated way to write the rule?
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Rank Measure

Post by Wim Gielis »

Hello

Do you really expect an answer in this topic, given that in your past topics you did not bother to reply?

Wim
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
gdimit
Posts: 17
Joined: Tue Mar 22, 2011 10:15 am
OLAP Product: TM1
Version: 10.2.1
Excel Version: 2010

Re: Rank Measure

Post by gdimit »

Hi Wim,

I admit to be a bit lazy to reply but I have made only 3 posts including this one.

Now that I am replying do you have any suggestion?

Thanks in advance
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Rank Measure

Post by Wim Gielis »

I would use a TI process, based on an MDX subset that sorts dimension elements based on values in a cube.
I'd rather not use rules here.
Obviously, this is my guidance based on the little information you provided.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
gdimit
Posts: 17
Joined: Tue Mar 22, 2011 10:15 am
OLAP Product: TM1
Version: 10.2.1
Excel Version: 2010

Re: Rank Measure

Post by gdimit »

Unfortunately TI process is not an option in my case.

What other information do you need to provide you in order to give me some extra tips?
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: Rank Measure

Post by tomok »

Trying to rank measures with a rule is completely impractical for anything other than the simplest of cubes. Why even try when you can get the ranking via a report using an MDX query and the TOPCOUNT function? That's what it's for. If you had a SQL database you wouldn't calculate rank via a stored procedure or something dumb like that, you would simply query using ORDER BY.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
gdimit
Posts: 17
Joined: Tue Mar 22, 2011 10:15 am
OLAP Product: TM1
Version: 10.2.1
Excel Version: 2010

Re: Rank Measure

Post by gdimit »

Thank for you replies.

I can fully understand that it is not the best practise to create a rank using a rule.

But my quenstion remains. If there is a more sophisticated way to right this rule.
Post Reply