Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDX IIF statement help. Can IS TRUE be used?? 1

Status
Not open for further replies.

eo

MIS
Apr 3, 2003
809
I need to create some MDX that will show a value based on which dimension member is selected. I know this is possible using a SCOPE statement, but am thinking that an IIF statement is more appropriate as it must be embedded into a larger SCOPE statement.

Not going into too much detail as you might not understand the context of the problem I am trying to resolve, and am still only in the proof of concept stage, so basically the IIF statement must deliver either a 1 or 0 based on which dimension hierarchy member is selected.

Code:
CREATE MEMBER CURRENTCUBE.[MEASURES].[LPRate_test]
  AS 
    IIF([Currency Conversion Type].[CurrConvType].[Rate Type].&[Lloyds Business Planning] is true,
        1, 0)
, FORMAT_STRING = "#,#", VISIBLE = 1;

I tried this above, but it does not work, and I am thinking the issue is with the logical expression part. In plain English, I am trying to say that if the user selects the dimension member [Currency Conversion Type].[CurrConvType].[Rate Type].&[Lloyds Business Planning], then the value returned must be 1, if they select anything else, then it must be 0. I am using "is true" for this as I do not know how else to do this??

Any suggestions??

EO
Hertfordshire, England
 
Code:
    IIF([Currency Conversion Type].[CurrConvType].[Rate Type].CurrentMember.Name = "Lloyds Business Planning",
        1, 0)
 
This seems more likely yes, but the result is not 1 or 0, but rather null. Any idea why that might be the case??

EO
Hertfordshire, England
 
I think this is almost there...thanks!!

EO
Hertfordshire, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top