dbTalk Databases Forums  

flexible rank when browsing with excel - how do i find the first measure?

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


Discuss flexible rank when browsing with excel - how do i find the first measure? in the microsoft.public.sqlserver.olap forum.



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

Default flexible rank when browsing with excel - how do i find the first measure? - 09-22-2005 , 11:35 AM






Good morning,

My customers are fanatical about wanting to see ranks of various
measures as they browse using excel pivot tables. From Tom Chester and
other I've tried to incorporate the flexible "visual rank" below but
what I get is an "infinite recursion detected" error (I see this
message using the cube browser in bi studio 2005. In excel, I just see
#VALUE!)

CREATE MEMBER CURRENTCUBE.[MEASURES].[Visual Rank]
AS Rank(StrToSet("Axis(1)").Item(0).Item(0).Dimension .CurrentMember,
ORDER(StrToSet("Axis(1)"),
StrToSet("Axis(0)").Item(0).Item(0),
BDESC)),
VISIBLE = 1;

StrToSet("Axis(0)").Item(0).Item(0) is not the first measure even
though it's the first column in the data area? Is there a way to find
the first measure?

If I specify the measure explicitly it works but it is not flexible

CREATE MEMBER CURRENTCUBE.[MEASURES].[Visual Rank Sales]
AS Rank(StrToSet("Axis(1)").Item(0).Item(0).Dimension .CurrentMember,
ORDER(StrToSet("Axis(1)"),
[Measures].[Sales],
BDESC)),

Any guidance would be much appreciated.

Thanks!


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

Default Re: flexible rank when browsing with excel - how do i find the first measure? - 09-22-2005 , 08:40 PM






This query seems to work in a copy of the AS 2000 Foodmart Sales cube,
after creating [Measures].[VisualRank]:

Quote:
Select {[Measures].[Unit Sales], [Measures].[Profit],
[Measures].[VisualRank]} on columns,
NonEmptyCrossJoin([Store].[Store City].Members) on rows
from Sales2
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
alanr
 
Posts: n/a

Default Re: flexible rank when browsing with excel - how do i find the first measure? - 09-23-2005 , 08:25 AM



The problem is that I am not creating the query by hand. It is
generated by excel pivot table services so the measure isn't "on
columns". What's on the columns axis is another dimension so maybe
it's product or country or nothing?

Help?

Thanks again!


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

Default Re: flexible rank when browsing with excel - how do i find the first measure? - 09-23-2005 , 12:26 PM



The [VisualRank} laso worked for me in an Excel Pivot table, but then I
did have just measures on columns. I'm not sure what your general
scenario is - where will [VisulRank] show up, if measures are not on
columns?


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #5  
Old   
alanr
 
Posts: n/a

Default Re: flexible rank when browsing with excel - how do i find the first measure? - 09-27-2005 , 01:06 PM



Thank you Deepak!

I've made some reasonable progress with this.

The measure that I was trying to find appears on either the row or
column axis depending on the number dimensions, etc. that the user adds
so the resulting "create member" statement is complicated (a few iifs)
but works.

My next challenge is how to make this perform. I get horrible
performance because the ORDER gets run for each cell.

Is there some way to cache this within a "create member"? Any other
ideas?

Thanks again!
Alan


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.