Change data type of Dimensions in Tableau Worksheet

Today, i will discuss about how to change the data type of a Dimension in Tableau. See the image below with population data (city and state wise).

So, the file has city name ,state and Population.  Open Tableau->click on excel->choose the file (population-data.xlsx) ->click Open. Hence, data is imported to Tableau. See the below image for the same.

 

Next step is click on Sheet1 (left bottom).  Once you open Sheet1 ,see the Dimensions and Measures  on the left pane as below.

Here , if you see clearly city name field  has string  data type and state field has Geo-spatial  data type. Symbol for string data type is “Abc” and for Geo-spatial data type is Globe. If you drag the “City Name” Dimension and “Population” Measure to the work space, the symbol maps will not get enables in “Show me” (Top right section). Reason  is “City Name” is string type. Therefore, there is a need to change the data type of “City Name” field to geo-spatial data type.

Follow the below steps to change the data type of  a field to Geo-spatial data type.

Right click on the field (Dimension pane)  .Go to Geographic Role-> select city. Now , the data type has changed. Hence , the symbol maps are enabled. See the below images for the same. Here i have given an example how to change the string data type to Geo-spatial data type and need for it. You can  do data type conversion in same fashion. But remember, you should know why you are doing data type conversion.

 

Related posts