Case statement in a calculation get rid of the ( )'s

This topic has 0 replies, 1 voice, and was last updated 4 years, 11 months ago by Frank.

  • Author
    Posts
    • #305
       Frank
      Keymaster
      • Topics Started - 80
      • Replies Written - 53

      If you have multiple conditions to test for in a calculation you can use nested Iif’s or you can use a Case statement.

      The syntax for a Case statement in Stratum would look something like this:
      CASE statements can be used in Viewer calculated measure expressions. Syntax is shown below.

      *********************************

      CASE [Customer SoldTo].[Customer SoldTo].Properties(“SldTo Long Description”)

      WHEN “Midwest Providers” THEN 1

      WHEN “North Providers” THEN 2

      WHEN “South Providers” THEN 3

      ELSE 99

      END

      *********************************

      Of course what you are checking for could be things like the the CurrentMember or a measure value greater than or less than a number of values.

      We’ve used this to set a value to different values in a calculated columns so that we can set a Conditional Format on a number of different conditions.

      The nice thing about the Case statement (IMHO) is that you don’t have to deal with getting the parentheses to match up….I seem to be “(” challenged.

      • This topic was modified 4 years, 11 months ago by Frank.
Viewing 0 reply threads

You must be logged in to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

©2021 KLEO Template a premium and multipurpose theme from Seventh Queen

Log in with your credentials

or    

Forgot your details?