Page 1 of 1

Rank Measure

Posted: Mon Sep 24, 2012 1:11 pm
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?

Re: Rank Measure

Posted: Mon Sep 24, 2012 5:02 pm
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

Re: Rank Measure

Posted: Mon Sep 24, 2012 8:24 pm
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

Re: Rank Measure

Posted: Mon Sep 24, 2012 11:02 pm
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.

Re: Rank Measure

Posted: Tue Sep 25, 2012 11:20 am
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?

Re: Rank Measure

Posted: Tue Sep 25, 2012 12:55 pm
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.

Re: Rank Measure

Posted: Wed Sep 26, 2012 7:55 am
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.