1 Reply Latest reply on Mar 27, 2013 10:52 AM by Joshua Milligan

    Using boolean dimensions in calculated fields??

    alan.zaccone

      I have three boolean dimensions (silver, gold, platinum) that determine how much a customer pays for my service. Each level costs an additional $1 on top of the $5 base charge. I would like to create a calculated field (billing amount) that checks to see whether each boolean dimension is true or false and then calculates the price depending on the result. [Subscriptions] is a measure.

       

      I tried to do:

       

      IF [Silver]= "TRUE" and [Gold]= "TRUE" and [Platinum]= "TRUE" THEN [Subscriptions]*8

      ELSEIF [Silver]= "TRUE" and [Gold]= "TRUE" and [Platinum]= "FALSE" THEN [Subscriptions]*7

      ELSEIF [Silver]= "TRUE" and [Gold]= "FALSE" and [Platinum]= "FALSE" THEN [Subscriptions]*6

      ELSEIF [Silver]= "FALSE" and [Gold]= "FALSE" and [Platinum]= "FALSE" THEN [Subscriptions]*5

      END

       

      This does not work. How do I make the calculation test the boolean dimensions to see whether they return TRUE or FALSE?

        • 1. Re: Using boolean dimensions in calculated fields??
          Joshua Milligan

          Alan,

           

          If Silver, Gold, and Platinum fields are boolean, then the code would probably look something like:

           

          IF [Silver] AND [Gold] AND [Platinum] THEN [Subscriptions]*8

          ELSEIF [Silver] AND [Gold] THEN [Subscriptions]*7

          ELSEIF [Silver] THEN [Subscriptions]*6

          ELSE [Subscriptions]*5

          END

           

          If that doesn't work, please post a packaged workbook with dummy data and I'd be happy to take a look!

           

          Regards,

          Joshua