2 Replies Latest reply on May 2, 2013 9:17 AM by Santhosh Shetty

    calculated field and inlist func

    Santhosh Shetty

      Hi,

       

      I am trying to build a calculated field, and looking for 'in' or 'inlist' logical oper.

      example :

      if [Country] in ('USA', CANADA','MEXICO') then 'AMER' elseif .... end

       

      Any help appreciated..!

        • 1. Re: calculated field and inlist func
          Joshua Milligan

          Santhosh,

           

          You may have to write the calculation something like this:

           

          IF

               [Country] = "USA"

          OR [Country] = "CANADA"

          OR [Country] = "MEXICO"

          THEN "AMER"

          ELSEIF

               [Country] = "FRANCE"

          OR [Country] = "SPAIN"

          THEN "EUROPE"

          ...

          ...

          END

           

           

          You could also use the ad hoc grouping capabilities in Tableau to create groups for countries.  Depending on your needs, the calculated field will be more flexible, but the ad hoc groups are relatively easy to create.

           

          Regards,

          Joshua

          • 2. Re: calculated field and inlist func
            Santhosh Shetty

            Thanks Joshua..

            the code I have is an example.. real calculation is little long and complex, and based on multiple fields (group cannot be used). Inlist is very basic and commonly used...Adding it to the wishlist.