Learn Tableau — Assign a geographic role to a data field
A geographic role ensures that location data is mapped correctly in the view. There are two ways to assign a geographic role to a data field.
Short of time? Scroll to the bottom for the short version.
Tableau has a built in map server that can create a map view of your location data. For example, if you have a field consisting of a list of states and you drag it to the View, Tableau automatically creates a map for you:
To make sure that the data is plotted correctly you can assign a geographic role to a field. This will tell Tableau that the field contains a list of cities, or a list of countries, or a different type of location. That way, the ‘Nederland, CO, USA’ value will not be mistaken for the country ‘Nederland.’
You can choose from these geographical roles (some are only available for locations within the U.S.):
- Airport
- Area Code (U.S.)
- CBSA/MSA (U.S.)
- City
- Congressional District (U.S.)
- Country/Region
- County
- NUTS Europe
- State/Province
- ZIP Code/Postcode
A geographic role associates each location value of the field with a latitude and longitude value. Additionally, two fields are added to the Data pane: Latitude (generated) and Longitude (generated).
There are two ways to assign a geographic role to a data field: From the data field name and from the data field icon.
First method: Data field name
- Right-click on the field name in the Data pane. A drop-down opens.
- Click on Geographic Role. A list of geographic roles opens.
- Choose a role. The role that you choose will get a checkmark.
Second method: Data field icon
- Click on the icon to the left of the field name in the Data pane. A drop-down opens.
- Click on Geographic Role. A list of geographic roles opens.
- Choose a role. The role that you choose will get a checkmark.
The short version
There are two ways to assign a geographic role to a data field:
- Right-click on the field name in the Data pane and choose Geographic role.
- Click on the icon to the left of the field name and choose Geographic role.
Questions? I love questions! Please leave them in the comments below and I will get back to you as soon as I can.
Disclaimer: I am in no way affiliated with Tableau.
This article is based on Tableau Public 2021.1 and uses the FAA Wildlife Strikes, 2015 dataset provided by Tableau.