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.

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:

Map View.
Map View.

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

  1. Right-click on the field name in the Data pane. A drop-down opens.
  2. Click on Geographic Role. A list of geographic roles opens.
  3. Choose a role. The role that you choose will get a checkmark.
Assign a geographic role from the field name.
Assign a geographic role from the field name.

Second method: Data field icon

  1. Click on the icon to the left of the field name in the Data pane. A drop-down opens.
  2. Click on Geographic Role. A list of geographic roles opens.
  3. Choose a role. The role that you choose will get a checkmark.
Assign a geographic role from the field icon.
Assign a geographic role from the field icon.

The short version

There are two ways to assign a geographic role to a data field:

  1. Right-click on the field name in the Data pane and choose Geographic role.
  2. 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.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store