dbTalk Databases Forums  

Percent Rank for set of Values

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Percent Rank for set of Values in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joel Cazzell
 
Posts: n/a

Default Percent Rank for set of Values - 10-15-2004 , 05:22 PM








Greetings,

I have a Calculated Measure that I would like to rank over a set of
data. Rather than illustrate the numeric rank, I would like to display
the value as a percentage. (Just like Excels PercentRankFunction). I
can't seem to get it to work.

I have a BusinessUnit, Position, CallCenter and Agent dimension that
will comprise the set.

I want to rank the employees who fall into

BusinessUnit.X, Position.II, and CallCenter.MyCenter

Lets call the Measure that I want to rank MyMeasure.

How will I achive this in MDX? How will my set look? Do i need to use
SetToArray?

Any input would be greatly appreciated. THank you so much!!

Joel

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Percent Rank for set of Values - 10-19-2004 , 04:31 PM






Here's an example MDX query for Foodmart Sales cube. The Axis() is used
instead of [CustomerSet] for flexibility:

Quote:
With Set [CustomerSet] as
'NonEmptyCrossJoin([Customers].[Name].Members,
{[Education Level].[All Education Level].[Graduate Degree]},
{[Gender].[All Gender].[F]},
{[Marital Status].[All Marital Status].[M]}, 1)'

Member [Measures].[SalesPctRank] as
'(Rank(Axis(1).Item(0).Item(0).Dimension.CurrentMe mber,
Order(Axis(1), [Measures].[Unit Sales], BASC)) - 1)
/(Axis(1).Count - 1)',
FORMAT_STRING = 'Percent'

Select {[Measures].[Unit Sales], [Measures].[SalesPctRank]} on columns,
[CustomerSet] on rows
from Sales
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.