1 Reply Latest reply on Jan 11, 2014 6:44 AM by KK Molugu

    Calc to return 2 values

    Kevin Sullivan

      I am looking to create a calculation that will return 2 values.  the below formula is only returning value 1 but I want to see 1 and 2.

       

      Name of calc is PATH

      If [Previous Business Unit Name]<> ' ' then 1 elseif [Business Unit Name]<> ' ' then 2 end

       

      neither field will ever be null and I want it to return both values.

       

      Example

       

      Previous Business Unit Name    Business Unit Name    PATH

      Marketing Unit                           Finance Unit                1  

      Marketing Unit                           Finacne Unit                2 

        • 1. Re: Calc to return 2 values
          KK Molugu

          Kevin:

           

          Just to understand your question here; you want

          - PATH = 12 when Previous Business Unit Name and Business Unit Name are both not empty

          - PATH = 1 when Previous Business Unit Name is not empty

          - PATH = 2 when Business Unit Name is not empty

          - PATH = "" when Previous Business Unit Name and Business Unit Name are both empty

           

          If this is true, you need to change your if conditional statement. If condition exists when it first matches the matching criteria. In your example, as soon as is sees that the Prev BU is not empty it returns 1 and exists the loop. Use the below instead;

           

          if ([Previous Business Unit Name] <> "" and [Business Unit Name] <> "") then "12"

          elseif ([Previous Business Unit Name] <> "") then "1"

          elseif ([Business Unit Name] <> "") then "2"

          else ""

          end

           

          Hope this helps

          KK Molugu

          1 of 1 people found this helpful