0
0
Tableaubi_tool~10 mins

Custom geocoding in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This data represents a small custom geocoding table with city names and their latitude and longitude coordinates.

CellValue
A1City
A2Springfield
A3Rivertown
A4Lakeside
B1Latitude
B239.78
B340.12
B438.95
C1Longitude
C2-89.64
C3-88.45
C4-90.12
Formula Trace
IF [City] = 'Springfield' THEN MAKEPOINT(39.78, -89.64) ELSEIF [City] = 'Rivertown' THEN MAKEPOINT(40.12, -88.45) ELSEIF [City] = 'Lakeside' THEN MAKEPOINT(38.95, -90.12) ELSE NULL END
Step 1: [City] = 'Springfield'
Step 2: MAKEPOINT(39.78, -89.64)
Step 3: [City] = 'Rivertown'
Step 4: MAKEPOINT(40.12, -88.45)
Step 5: [City] = 'Lakeside'
Step 6: MAKEPOINT(38.95, -90.12)
Step 7: ELSE NULL
Step 8: Complete IF statement evaluation per row
Cell Reference Map
    A          B          C
1 | City     | Latitude | Longitude |
2 | Springfield -> 39.78 -> -89.64 |
3 | Rivertown  -> 40.12 -> -88.45 |
4 | Lakeside   -> 38.95 -> -90.12 |
The formula uses the City names in column A to match and assign latitude and longitude from columns B and C.
Result
    A          D
1 | City     | Geo Point            |
2 | Springfield | (39.78, -89.64)    |
3 | Rivertown  | (40.12, -88.45)     |
4 | Lakeside   | (38.95, -90.12)     |
The result column D shows the geographic points created by the custom geocoding formula for each city.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the MAKEPOINT function do in this formula?
AReturns NULL if city is unknown
BChecks if the city name matches
CCreates a geographic point from latitude and longitude
DCalculates distance between two points
Key Result
IF city name matches a known city THEN create geographic point with its latitude and longitude ELSE return NULL