dbTalk Databases Forums  

MDX Rank problem

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


Discuss MDX Rank problem in the microsoft.public.sqlserver.olap forum.



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

Default MDX Rank problem - 04-26-2005 , 04:38 AM






Hi All,

I don't understand one thing in a query below:

WITH SET [SET1] AS
'ORDER ({[Education Level].[Education Level].Members}, [Gender].[All
Gender].[F], ASC)'
MEMBER [Gender].[RANK1] AS 'rank([Education Level].currentmember, [SET1])'
select
{[Gender].[All Gender].[F], [Gender].[RANK1]} on columns,
{[Education Level].[Education Level].Members} on rows
from Sales
where
([Measures].[Store Sales Net])

This query is ok but if I change WHERE statement for:
([Measures].[Profit])

RANK1 column is filled with values "0,00"
Can somebody give me any explanation, why it is so?

Peter



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

Default Re: MDX Rank problem - 04-26-2005 , 02:56 PM






Looks like a Solve Order issue - [Store Sales Net] is an intrinsic
measure with a lower Solve Order than [Profit], which is a calculated
measure with a Solve Order of 0. Making the Solve Order of [RANK1] > 0
ensures that it is calculated after [Profit], yielding the expected
result:

Quote:
WITH SET [SET1] AS
'ORDER ({[Education Level].[Education Level].Members},
[Gender].[All Gender].[F], ASC)'
MEMBER [Gender].[RANK1] AS 'rank([Education Level].currentmember,
[SET1])',
SOLVE_ORDER = 10
select
{[Gender].[F], [Gender].[RANK1]} on columns,
{[Education Level].[Education Level].Members} on rows
from Sales
where
([Measures].[Profit])
Quote:

SQL Server 2000 BOL explain this in more detail:

http://msdn.microsoft.com/library/de.../en-us/olapdma
d/agmdxnonosfunct_3bzn.asp


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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

Default Re: MDX Rank problem - 04-28-2005 , 02:36 AM



Thanks!


"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote

Quote:
Looks like a Solve Order issue - [Store Sales Net] is an intrinsic
measure with a lower Solve Order than [Profit], which is a calculated
measure with a Solve Order of 0. Making the Solve Order of [RANK1] > 0
ensures that it is calculated after [Profit], yielding the expected
result:


WITH SET [SET1] AS
'ORDER ({[Education Level].[Education Level].Members},
[Gender].[All Gender].[F], ASC)'
MEMBER [Gender].[RANK1] AS 'rank([Education Level].currentmember,
[SET1])',
SOLVE_ORDER = 10
select
{[Gender].[F], [Gender].[RANK1]} on columns,
{[Education Level].[Education Level].Members} on rows
from Sales
where
([Measures].[Profit])



SQL Server 2000 BOL explain this in more detail:

http://msdn.microsoft.com/library/de.../en-us/olapdma
d/agmdxnonosfunct_3bzn.asp


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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



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.