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