Setting geographic roles

Once the data is loaded, Tableau will determine geographic fields using the field names, such as city, state, and zip code, and will generate latitude/longitude data for those fields. Tableau will denote the geographic fields by placing a globe symbol next to the field name. If Tableau misses the detection of any field, usually due to variations in field names, we can manually set these fields as geographic fields.

Getting ready

Let's use the sample file Sample – Superstore Sales (Excel). Open a new worksheet and select Sample – Superstore Sales (Excel) as the data source.

How to do it...

Once the data is loaded in Tableau, perform the following steps to set a few fields as geographic fields:

  1. Right-click on Customer Zip Code from Dimensions.
  2. Expand Geographic Role from the dropdown.
  3. Select Zip code/Postcode as shown in the following screenshot.
  4. Right-click on State under Customer City from Dimensions.
  5. Expand Geographic Role from the dropdown.
  6. Select State/Province from the options.
    How to do it...

How it works...

When the field names are different from conventional names, Tableau will not know that these fields are geographic fields. We can manually assign various fields as geographic fields, which generate latitude and longitude to be used in the maps. Sometimes Tableau cannot match a field to its internal data; for example, if there's a state called UH in our data, but Tableau does not have that value in the list of states of the US. In such cases, Tableau will prompt for mapping of the values from the data.

There's more...

In Tableau's documentation on geographic roles, you can find out which fields Tableau can geocode automatically; browse to http://onlinehelp.tableausoftware.com/v8.0/pro/online/en-us/maps_geographicroles.html. Geocoding of fields with information on area code, CBSA/MSA, congressional district, and county are limited to the US only.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset