dbTalk Databases Forums  

MDX Level Flagging

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


Discuss MDX Level Flagging in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jason.strate@performark.com
 
Posts: n/a

Default MDX Level Flagging - 07-11-2005 , 03:20 PM






Anyone have any idea why this MDX would be failing

(iif([SIC Code].Currentmember.level.name = "(All)", "[LevelFlag].[Level
Flag].&[Z]", "[LevelFlag].[Level Flag].&[S]"),[Measures].[zContact])

The error that I keep getting is:
Unable to update the calculated member.
Formula error - syntax error - token is not valid: "(iif([SIC
Code].Currentmember.level.name = "(All)", "[LevelFlag].[Level
Flag].&[Z]", "[LevelFlag].[Level Flag].&[S]")^,^[Measures].[zContact])"

I broke it apart and the following versions of the statement work fine
separately:

iif([SIC Code].Currentmember.level.name = "(All)", "[LevelFlag].[Level
Flag].&[Z]", "[LevelFlag].[Level Flag].&[S]")

([LevelFlag].[Level Flag].&[S], [Measures].[zContact])

I also tried the statement as:

(iif([SIC Code].Currentmember.level.name = "(All)", [LevelFlag].[Level
Flag].&[Z], [LevelFlag].[Level Flag].&[S]),[Measures].[zContact])

Jason


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

Default Re: MDX Level Flagging - 07-11-2005 , 10:41 PM






iif() is returning a string, which then needs to be converted to the
corresponding dimension member:

Quote:
(StrToMember(iif([SIC Code].Currentmember.level.name = "(All)",
"[LevelFlag].[LevelFlag].&[Z]",
"[LevelFlag].[Level Flag].&[S]")),
[Measures].[zContact])
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #3  
Old   
j strate
 
Posts: n/a

Default Re: MDX Level Flagging - 07-12-2005 , 10:27 AM



Thanks, that solved the problem.

Jason


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.