dbTalk Databases Forums  

How to use Level type in a MDX expression

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


Discuss How to use Level type in a MDX expression in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stig Torngaard Hammeken
 
Posts: n/a

Default How to use Level type in a MDX expression - 05-02-2006 , 03:53 PM






How do I get the level type meta data from a dimension/levels currentmember.
I would expect somthing like
[Periode].[YMD].currentmember(0).level.Properties("LevelType")

The reason is that I would like to have my "Full year Estimate" calculated
measure like below, instead of hard code level.ordinal or level.name

IIF(

[Periode].[YMD].currentmember(0).level.Properties("LevelType")="T imeYear",

[Measures].[Estimate],

([Measures].[Estimate],ancestor([Periode].[YMD].currentmember(0),[Periode].[YMD].[Year]))

)

Thanks for any input
Stig Torngaard, Platon



Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: How to use Level type in a MDX expression - 05-03-2006 , 08:03 AM






I don't think that this property is exposed through MDX, but while
looking into your question I noticed that you already have the member
name hard coded in the 'else' clause of your iif().

The other thing is that the iff statement is redundant. You could just
use the following:

([Measures].[Estimate],ancestor([Periode].[YMD].currentmember(0),
[Periode].[YMD].[Year]))


--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <uGA1SqibGHA.1112 (AT) TK2MSFTNGP05 (DOT) phx.gbl>, torngaard (AT) yahoo (DOT) com
says...
Quote:
How do I get the level type meta data from a dimension/levels currentmember.
I would expect somthing like
[Periode].[YMD].currentmember(0).level.Properties("LevelType")

The reason is that I would like to have my "Full year Estimate" calculated
measure like below, instead of hard code level.ordinal or level.name

IIF(

[Periode].[YMD].currentmember(0).level.Properties("LevelType")="T imeYear",

[Measures].[Estimate],

([Measures].[Estimate],ancestor([Periode].[YMD].currentmember(0),[Periode].[YMD].[Year]))

)

Thanks for any input
Stig Torngaard, Platon




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.