INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

(OP)
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

RE: MDX IIF statement help. Can IS TRUE be used??

CODE

    IIF([Currency Conversion Type].[CurrConvType].[Rate Type].CurrentMember.Name = "Lloyds Business Planning",
        1, 0)

RE: MDX IIF statement help. Can IS TRUE be used??

(OP)
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

RE: MDX IIF statement help. Can IS TRUE be used??

Try taking out [Rate Type] from the code

RE: MDX IIF statement help. Can IS TRUE be used??

(OP)
I think this is almost there...thanks!!

EO
Hertfordshire, England

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close