Tableau Course
Geospatial Analysis
Geospatial analysis in Tableau goes beyond plotting points on a map — it includes spatial joins, custom territories, distance calculations, and polygon-based filtering that let you answer complex location questions directly inside Tableau without external GIS tools.
Custom Territories — Grouping Locations Your Own Way
Tableau's built-in geographic hierarchy (Country → State → City) reflects standard administrative boundaries. But businesses rarely operate on standard boundaries. A sales team may cover custom territories — the Southeast territory might include Florida, Georgia, Alabama, and Mississippi but not the Carolinas. Custom territories let you define these groupings directly inside Tableau without altering the source data.
Custom Territory Map — Labelled Mockup
Spatial Files — Bringing in External Boundaries
For boundaries that Tableau does not have built in — custom sales territories from a CRM, school catchment areas, flood zones, delivery radius polygons — you can import external spatial files directly as a data source. Tableau supports the following spatial file formats:
Spatial Joins — Combining Point Data with Polygon Boundaries
A spatial join combines a dataset of point locations (such as customer addresses with latitude and longitude) with a dataset of polygon boundaries (such as a shapefile of sales territories) to determine which polygon each point falls inside. The result is a joined table where every customer row gains a Territory field — without any geocoding service or external processing.
Spatial Join — Data Flow Mockup
Buffer Zones and Distance Analysis
Tableau supports the BUFFER() spatial function which creates a circular polygon of a specified radius around a point. This is useful for proximity analysis — for example, identifying all customers within 50 miles of a warehouse, or all stores within 10 kilometres of a competitor location. The BUFFER() function is used in a calculated field:
BUFFER(MAKEPOINT([Latitude], [Longitude]), 50, 'mi')
MAKEPOINT() converts a pair of Latitude and Longitude number columns into a Tableau geometry object. BUFFER() then expands that point into a circle of the given radius. The supported distance units are 'mi' (miles), 'km' (kilometres), 'm' (metres), and 'ft' (feet).
Geospatial analysis is where Tableau starts to replace tools that analysts previously needed ArcGIS or Python's GeoPandas library for. The spatial join with Intersects is particularly powerful because it answers the most common territory question in business — "which territory does this customer belong to?" — without any programming and without modifying the source data. The BUFFER() and MAKEPOINT() functions are relatively recent additions to Tableau and are only available when your geographic data comes from coordinate columns rather than named place fields. If your data has a Latitude column and a Longitude column as numbers, MAKEPOINT converts them into geometry objects that BUFFER, spatial joins, and DISTANCE() calculations can all act on. The DISTANCE() function — DISTANCE(MAKEPOINT([Lat1],[Long1]), MAKEPOINT([Lat2],[Long2]), 'km') — calculates the straight-line distance between any two coordinate pairs, opening up nearest-location analysis, delivery radius checks, and territory assignment validation directly inside a calculated field.
Practice Questions
1. On a filled map, you want to group Florida, Georgia, Alabama, and Mississippi into a single Southeast Territory. How do you create this custom territory directly on the map?
2. You have a warehouse locations table with Latitude and Longitude columns. Write the calculated field that creates a 50-mile delivery radius polygon around each warehouse.
3. You are joining a customer points table to a territory shapefile on the Data Source tab. Which join condition correctly assigns each customer to the territory polygon containing their location?
Quiz
1. A dataset has separate Latitude and Longitude columns stored as decimal numbers. Before using BUFFER() on them, which function must be applied first?
2. A colleague has custom delivery zone boundaries exported from their CRM as a .geojson file. Can Tableau connect to this file directly as a data source?
3. A sales manager needs a map where each territory matches the company's custom regional boundaries — not US Census regions or standard state groupings. The simplest Tableau approach that requires no external spatial files is?
Next up — Lesson 31: Filters in depth — understanding the full filter order, context filters, and building interactive filter controls for dashboards.