Geographic Roles and Location Fields in Tableau
1. Introduction to Geographic Roles and Location Fields
Geographic Roles and Location Fields are important features in Tableau that help users analyze data based on geographical locations such as countries, states, cities, postal codes, and latitude-longitude coordinates. They allow Tableau to recognize location-related information and represent it visually on maps.
For example, a sales dataset may contain Country, State, City, Sales, and Profit fields. By assigning the correct geographic roles to Country, State, and City, Tableau can create maps that display sales performance across different locations.
Learning Objectives
- Understand geographic roles and location fields in Tableau.
- Identify different types of geographic fields.
- Learn how to assign and change geographic roles.
- Understand the difference between location names and coordinates.
- Use geographic fields to create maps and analyze business data.
- Resolve common problems with unrecognized or ambiguous locations.
2. What Are Geographic Roles?
A Geographic Role is a property assigned to a field that tells Tableau what type of geographical information the field contains. Tableau uses this information to identify locations and match them with geographic coordinates so they can be displayed on a map.
For example, if a field contains values such as Mumbai, Pune, and Delhi, assigning the City geographic role tells Tableau to interpret those values as city names.
Example
City
Mumbai
Pune
Delhi
Bengaluru
If the City field has the correct geographic role, Tableau can use its built-in geocoding information to locate the cities and generate a map view.
Why Are Geographic Roles Important?
- They help Tableau recognize location-related data.
- They enable automatic map creation.
- They help Tableau match locations to latitude and longitude coordinates.
- They improve geographical analysis and visualization.
- They reduce the need to manually enter coordinates for supported locations.
3. What Are Location Fields?
Location fields are columns in a dataset that contain geographical information. They may contain location names, administrative divisions, postal codes, or numerical coordinates.
Location fields can be used to identify where customers live, where sales occur, where products are delivered, or where business operations are located.
Examples of Location Fields
| Field Name |
Example Values |
Purpose |
| Country |
India, Canada, Japan |
Identifies countries. |
| State |
Maharashtra, Gujarat, Karnataka |
Identifies states or provinces. |
| City |
Mumbai, Pune, Delhi |
Identifies cities. |
| Postal Code |
400001, 411001, 110001 |
Identifies postal delivery areas. |
| Latitude |
19.0760 |
Represents a north-south geographic position. |
| Longitude |
72.8777 |
Represents an east-west geographic position. |
Location Fields in Business Analysis
Businesses use location fields to identify their strongest sales regions, understand customer distribution, monitor delivery performance, compare regional profitability, and plan marketing campaigns.
4. Types of Geographic Roles in Tableau
Tableau supports several geographic roles. The available roles depend on the type of location data and the geographic formats recognized by Tableau.
| Geographic Role |
Description |
Example |
| Country/Region |
Identifies countries, regions, or territories. |
India |
| State/Province |
Identifies first-level administrative divisions. |
Maharashtra |
| City |
Identifies recognized cities. |
Mumbai |
| County |
Identifies supported second-level administrative divisions. |
A county or equivalent division in a supported country |
| ZIP Code/Postcode |
Identifies supported postal code areas. |
400001 |
| Latitude |
Represents latitude in decimal degrees. |
19.0760 |
| Longitude |
Represents longitude in decimal degrees. |
72.8777 |
| Airport |
Recognizes supported airport identifiers. |
BOM |
| Area Code (US) |
Identifies supported US telephone area codes. |
A US area code |
| CBSA/MSA (US) |
Identifies supported US metropolitan statistical areas and related regions. |
A recognized CBSA/MSA |
| Congressional District (US) |
Identifies US congressional districts. |
A supported district identifier |
| NUTS Europe |
Identifies supported European statistical regions. |
A recognized NUTS code |
Important: Not every geographic role supports every country or naming format. For example, some postal-code and administrative-area roles are country-specific. Check the role and location formats supported by your Tableau version when working with unfamiliar data.
5. Understanding the Globe Icon
In Tableau's Data pane, a globe icon next to a field indicates that a geographic role has been assigned to that field. This icon helps users identify fields that Tableau can interpret as geographic information.
Example
Country 🌐
State 🌐
City 🌐
Sales
Profit
In this example, Country, State, and City are geographic fields. Sales and Profit are numerical business measures rather than location fields.
When a geographic field is added to a worksheet, Tableau can use its assigned role to create a map view if the location is recognized and the data is suitable.
6. How to Assign a Geographic Role
Sometimes Tableau automatically recognizes location fields. When it does not, you can manually assign the correct geographic role.
Step-by-Step Process
- Open Tableau Desktop and connect to your dataset.
- Open the Data Source page or a worksheet.
- Locate the field containing geographical information, such as City.
- Click the field's data type icon or right-click the field in the Data pane.
- Select Geographic Role.
- Choose the appropriate role, such as City, State/Province, or Country/Region.
- Check whether the field displays a globe icon.
- Double-click the geographic field or drag it to Detail on the Marks card to begin creating a map.
Example
Suppose the City field contains Mumbai, Pune, and Delhi, but Tableau does not recognize it as geographic data.
Right-click City
↓
Geographic Role
↓
City
↓
Add City to the worksheet
↓
Create a map view
After assigning the correct role, Tableau can attempt to geocode recognized city values and plot them on a map.
7. Geographic Roles vs. Data Types vs. Data Roles
These concepts are related, but they serve different purposes in Tableau.
| Concept |
Meaning |
Example |
| Data Type |
Defines the kind of value stored in a field. |
String, Number (decimal), Date |
| Geographic Role |
Defines how Tableau interprets a location field. |
City, Country/Region, Latitude |
| Data Role |
Determines how Tableau uses a field in analysis, commonly as a dimension or measure. |
City as a dimension; Sales as a measure |
Example
A Postal Code field might contain values such as 00401 or 400001. If Tableau interprets postal codes as numbers, leading zeros may be lost. Setting the field's data type to String preserves the code's text representation. You can then assign the appropriate ZIP Code/Postcode geographic role if the code format and country are supported.
Remember: A correct data type does not automatically guarantee a correct geographic role. Both must be appropriate for the data.
8. Location Names and Geographic Coordinates
Tableau can work with named locations as well as latitude and longitude coordinates.
A. Named Locations
Named locations use descriptive values such as country names, state names, city names, and supported postal codes. Tableau attempts to match these values with its geographic information.
Country State City
India Maharashtra Mumbai
India Gujarat Ahmedabad
India Karnataka Bengaluru
B. Latitude and Longitude
Latitude and longitude identify a geographic position using numerical coordinates.
- Latitude: Measures position north or south of the Equator.
- Longitude: Measures position east or west of the Prime Meridian.
For example, Mumbai is approximately located at latitude 19.0760 and longitude 72.8777. These values are illustrative coordinates; the exact point depends on the chosen location within the city.
Location Latitude Longitude
Mumbai 19.0760 72.8777
Delhi 28.6139 77.2090
Bengaluru 12.9716 77.5946
When using your own coordinate fields, ensure they are numeric decimal values and assign the Latitude and Longitude geographic roles as appropriate.
9. Generated Latitude and Longitude Fields
When Tableau recognizes a geographic field and assigns a supported geographic role, it can generate two fields in the Data pane:
- Latitude (generated): Supplies latitude values for recognized locations.
- Longitude (generated): Supplies longitude values for recognized locations.
These generated fields help Tableau position marks on the map. They are different from latitude and longitude columns supplied directly in your dataset.
How to Use Them
- Assign a geographic role to a supported location field.
- Open a worksheet and add the location field to the view.
- Observe the generated latitude and longitude fields on the Rows and Columns shelves.
- Add measures such as Sales or Profit to Color, Size, or Tooltip to analyze the locations.
If your dataset already contains coordinates, you can use those fields instead of relying solely on generated coordinates.
10. Creating a Map Using Geographic Roles
Once location fields have appropriate geographic roles, you can create a map to explore geographical patterns in your data.
Step-by-Step Example: Sales by City
- Connect Tableau to a dataset containing Country, State, City, and Sales.
- Verify the data types and geographic roles of the location fields.
- Open a new worksheet.
- Double-click City or drag it to Detail on the Marks card.
- Confirm that Tableau generates a map using recognized locations.
- Drag Sales to Color to compare sales values.
- Drag Sales to Size if you want the mark sizes to represent sales magnitude.
- Drag City and Sales to Tooltip or Label when appropriate.
- Review the map for missing, duplicated, or incorrectly placed locations.
Example Dataset
| City |
Sales |
Profit |
| Mumbai |
150000 |
30000 |
| Pune |
95000 |
18000 |
| Delhi |
125000 |
25000 |
| Bengaluru |
110000 |
22000 |
With the City field assigned the City geographic role, the map can display recognized cities. Adding Sales to Color helps identify stronger sales locations, while Profit can be used in tooltips for additional analysis.
11. Understanding Location Hierarchies
A geographic hierarchy organizes location fields from broader areas to more detailed locations. It makes it easier to drill down into geographical data.
Example Hierarchy
Country
└── State/Province
└── City
└── Postal Code
Creating a Geographic Hierarchy
- In the Data pane, right-click the Country field.
- Select Hierarchy and then Create Hierarchy.
- Give the hierarchy a meaningful name, such as Geographic Location.
- Drag State, City, and Postal Code into the hierarchy in the correct order.
- Use the hierarchy on a worksheet to drill down from country to state, city, or postal-code detail.
Hierarchies are useful for comparing country-level performance and then investigating the states or cities contributing to those results. Ensure that the hierarchy reflects the actual geographic structure of your data.
12. Handling Ambiguous Locations
Some location names are shared by multiple places. A city name alone may not uniquely identify a location, especially when it exists in multiple states or countries.
Common Causes
- The same city name exists in different regions.
- The country or state is missing from the dataset.
- Location names use abbreviations or unfamiliar spellings.
- The field has an incorrect geographic role.
- The location is not included in Tableau's built-in geocoding information.
Ways to Resolve Ambiguous Locations
- Add Country and State fields to provide additional geographic context.
- Use consistent and standardized location names.
- Confirm that each field has the correct geographic role.
- Open the map's location settings or review unknown locations to identify unresolved values.
- Use your own latitude and longitude coordinates when reliable coordinates are available.
- For unsupported locations, consider custom geocoding where appropriate.
Example
Instead of using only a City field, use City together with State and Country.
City State Country
Springfield Illinois United States
Springfield Massachusetts United States
Additional geographic context helps Tableau distinguish between locations that share the same name.
13. Working with Postal Codes and Location Fields
Postal codes can be useful for local sales analysis, customer distribution, delivery planning, and territory reporting. However, postal-code formats vary between countries and may contain leading zeros or letters.
Best Practices
- Store postal codes as strings when they are identifiers rather than quantities.
- Preserve leading zeros and any required letters.
- Use the appropriate geographic role for the country and postal-code format.
- Include the country or other relevant geographic fields when needed.
- Check whether the postal-code format is supported by Tableau's geocoding information.
- Use verified coordinates or appropriate custom geocoding if postal-code areas are not recognized.
14. Geographic Roles in Business Intelligence
Geographic roles help convert location-related data into business insights.
| Business Use Case |
Location Field |
Business Benefit |
| Regional sales analysis |
Country, State, City |
Identifies high- and low-performing areas. |
| Customer segmentation |
City, Postal Code |
Shows where customer groups are concentrated. |
| Delivery planning |
City, Postal Code, Coordinates |
Helps visualize delivery destinations. |
| Marketing performance |
Country, State, City |
Compares campaign results across locations. |
| Store expansion |
City, State, Coordinates |
Supports geographical comparisons when evaluating new locations. |
| Profitability analysis |
State, City |
Highlights areas with strong or weak profit. |
15. Common Errors and Their Solutions
| Problem |
Possible Cause |
Solution |
| Map does not appear |
No recognized geographic field has been added to the view. |
Assign the correct geographic role and add the field to the worksheet. |
| Globe icon is missing |
The field has no geographic role. |
Choose Geographic Role from the field menu. |
| Some locations are missing |
Unrecognized names, unsupported locations, or missing values. |
Review unknown locations, clean the data, and verify geographic support. |
| Locations appear in the wrong place |
Ambiguous names or incorrect geographic context. |
Add State and Country fields and verify the assigned roles. |
| Postal codes lose leading zeros |
The field is interpreted as a number. |
Change its data type to String before using it as a postal identifier. |
| Custom locations cannot be mapped |
Locations are not supported by built-in geocoding. |
Use verified latitude and longitude coordinates or custom geocoding. |
| Too many marks appear |
The view contains multiple rows or detailed location records. |
Review the level of detail, aggregation, and fields on the Marks card. |
16. Practical Exercise: Create a Regional Sales Map
Objective: Build a Tableau map showing sales performance across Indian cities.
Sample Data
Country,State,City,Sales,Profit
India,Maharashtra,Mumbai,150000,30000
India,Maharashtra,Pune,95000,18000
India,Delhi,Delhi,125000,25000
India,Karnataka,Bengaluru,110000,22000
India,Gujarat,Ahmedabad,85000,15000
Tasks
- Connect Tableau to the dataset.
- Check the data types of Country, State, City, Sales, and Profit.
- Assign Country/Region, State/Province, and City geographic roles where necessary.
- Confirm that location fields are recognized and can be mapped.
- Create a map using City.
- Drag Sales to Color.
- Drag Profit to Tooltip.
- Add State and Country to the view if needed to clarify ambiguous locations.
- Review the map for unresolved or incorrectly matched locations.
- Save the workbook and write down three business observations from the map.
Expected Learning Outcome
You should be able to assign geographic roles, use location fields to create a map, analyze sales differences across cities, and troubleshoot common mapping issues.
17. Interview Questions and Answers
Q1. What is a geographic role in Tableau?
A geographic role tells Tableau what type of location a field represents, such as a city, state, country, or postal code.
Q2. What is a location field?
A location field contains geographical information such as a city name, country name, postal code, or geographic coordinate.
Q3. How can you identify a geographic field in Tableau?
A geographic field generally displays a globe icon in the Data pane when a geographic role has been assigned.
Q4. How do you assign a geographic role?
Open the field menu, select Geographic Role, and choose the role that matches the data.
Q5. What are Latitude and Longitude?
Latitude measures position north or south of the Equator, while longitude measures position east or west of the Prime Meridian.
Q6. What are generated latitude and longitude fields?
They are fields Tableau creates to position recognized geographic locations on a map.
Q7. What is the difference between a geographic role and a data type?
A data type defines the format of a value, while a geographic role defines how Tableau interprets a field as a location.
Q8. Why might Tableau fail to recognize a city?
The city may be unsupported, misspelled, formatted inconsistently, or ambiguous without state or country information.
Q9. Why should postal codes often be stored as strings?
Postal codes are identifiers, not quantities. A string preserves leading zeros and alphanumeric formats.
Q10. What is a geographic hierarchy?
It is an ordered structure of geographic fields, such as Country, State, City, and Postal Code, that supports drill-down analysis.
Q11. Can Tableau use latitude and longitude fields supplied by a dataset?
Yes. Numeric coordinate fields can be used to position data points when correctly configured.
Q12. What is geocoding?
Geocoding is the process of matching location information to geographic coordinates or positions.
Q13. What should you do when a location is ambiguous?
Add context such as State and Country, standardize names, and verify the geographic role.
Q14. Can Tableau map custom locations?
Yes, where appropriate, custom geocoding or verified latitude and longitude coordinates can be used for locations not recognized by built-in geocoding.
Q15. What are common business uses of geographic roles?
Common uses include regional sales analysis, customer distribution, delivery planning, marketing analysis, and location-based performance reporting.
18. Quick Revision Checklist
- Understand the meaning of geographic roles.
- Recognize location fields in a dataset.
- Identify the globe icon in the Data pane.
- Assign the correct geographic role to a field.
- Distinguish data types, data roles, and geographic roles.
- Understand generated and user-supplied coordinates.
- Create a map using recognized location fields.
- Use Country, State, and City to resolve ambiguous locations.
- Preserve postal codes as strings when appropriate.
- Investigate unknown locations and mapping errors.
- Apply geographic analysis to practical business scenarios.
19. Conclusion
Geographic Roles and Location Fields are essential for creating maps and performing location-based analysis in Tableau. Geographic roles tell Tableau how to interpret a location field, while location fields provide the actual geographical values. Correct data types, consistent location names, and appropriate geographic context help Tableau plot locations accurately. Once these fields are configured correctly, users can build interactive maps and analyze sales, customers, profitability, and other business measures by location.
20. Additional Learning Resources