2 Replies Latest reply on Oct 2, 2018 12:55 PM by Michael Gillespie

    How to Change a Dimension in Relation to Another Dimension

    peter.hix

      I realize that the title is not as useful as it could be but I'm not sure how to best phrase it.

       

      The issue I have is that one of my fields is Country and another is Region; one of the countries is India and some of the India rows have Asia as Region and others have IMEA as Region. I'd like to change all rows with India to be a part of the IMEA region rather than the Asia region.

       

      See below for tables that show what I'm trying to do.

       

      Current:

      RegionCountry
      IMEAIndia
      IMEAIndia
      AsiaIndia
      AsiaIndia
      IMEAIndia

       

      Target:

      RegionCountry
      IMEAIndia
      IMEAIndia
      IMEAIndia
      IMEAIndia
      IMEAIndia

       

      I can't figure out how to edit the Region from Asia to IMEA for only the rows with India as the country rather than all the Asia entries.

       

      Unfortunately this for sensitive data so I can't attach the workbook. Thank you for any help and let me know if more detail is needed.

        • 1. Re: How to Change a Dimension in Relation to Another Dimension
          Joshua Milligan

          Peter,

           

          What if you create a calculated field to replace Region with code like this:

           

          IF [Country] = "India" THEN "IMEA" ELSE [Region] END

           

           

          That will give you IMEA as the region for India and use the existing value of Region for all other countries.  You could then remove the old Region field.

           

          Hope that helps!

          Joshua

          • 2. Re: How to Change a Dimension in Relation to Another Dimension
            Michael Gillespie

            Exactly!

             

            Peter, the concept here is that Tableau can't change what's in the column.  The data is the data.  But Tableau CAN create a brand new column to hold the values you want.  You just create a calculated field as Joshua suggests.  Call it "Region (Corrected)" or something like that.  Use that new column wherever you would have used the original "Region" column.

             

            I wish Tableau's documentation explained concepts like this better: this is an extremely common question for new users and the answer, while simple, is not obvious!