
I'm attempting to do mapping for an international business (revenue, gross margin, etc) to show their distribution of customers, sales, profitability, etc by city, state, and country.
I found out the hard way that postal codes don't work for the UK and appear to also not work for Canada. Does anyone know what the lowest level/most specific dimension is that is recognized by Tableau for applying lat/lon that applies to most/all of Europe and N, America?
I'm shocked, shocked I say, that people are having to use an unexploded ordinance data set to do UK specific mapping by postal code. That solution can't be leveraged, AFAIK, to resolve the UK problem when also mapping data outside the UK.
Hi @Matt Gonzalez ,
If I'm understanding you right you want to map to the post code level in multiple countries at once, correct? If so that's not possible with the built-in Tableau mapping data for all countries. The available map data is listed at https://www.tableau.com/mapdata and it requires some interpretation & local knowledge (or web searching). For example the entry for Canada says Tableau supports post codes and 1645 of them but a web search says there are >800K active postcodes in Canada right now. Knowing that it's a subset the educated guess is that Tableau can map the FSA portion of the Canada post code (first three characters). Then I tested that out and that worked, then validated by digging into the Tableau install files. I also validated that for the UK Tableau's built in map data has the Outcodes (first 3 or 4 characters) but not the full post code.
And it is possible to build a map that combines both the full & partial postal code mapping that Tableau supports, here's a sample data set:
And then for the map I created a calculated field that only kept the portion of the post code that Tableau can map:
Of course this map isn't mapping at the full postcode level, for example per the data we'd want to see 2 marks for Edinburgh rather than just 1.
Therefore we need to get a single map we need a source of coordinates for those post codes for at least those countries that Tableau doesn't map, or just coordinates for all post codes. In the latter case we can just use those supplied coordinates and ignore Tableau's map data, in the former case we can plot the map using two layers: one for the supplied coordinates, and other for Tableau's map data.
I set this up in the attached workbook where I joined in coordinates for the UK & GB post codes
The US postcodes are plotted on the bottom layer using a calculated field that only returns the post code for those post codes we want to look up in Tableau. The Canada and GB post codes are plotted on the top layer using the lat & long. And in Edinburgh there are two marks as expected (one for each post code) that have the counts of 1 and 2 as expected and are plotting on top of each other due to the zoom level of the map.
The one field I want to point out is the Postcode for detail calculated that is on both map layers. This is the level of detail we want to aggregate to for both the map layers (so in this case it's the post code and the field does *not* have a geographic role so Tableau won't try to plot it) so that way color & size legends will stay in sync.
Hope this helps!
Jonathan