Tableau Location dimensions show null values on map

by Marcelo Ramos

There has been many times where I have become very confused as to why some of my location values won't appear on the map, so here is a possible reminder to me in the future or to a reader who has stumbled upon this blog post.

Why are there nulls?

Imagine you're indoors on a nice sunny day. You have Tableau open on your laptop and you're playing around with the Superstore dataset as you should. Life is good. But when you go to make a map and try to add the City dimension to the map you come up with this haunting image:

Do these cities not exist? Has this imaginary superstore created made-up cities? Fortunately, the answer is no. What is probably happening is that there are multiple cities with the same name and Tableau presents them as a Null value as it can't decide where to place the city. For example, Aberdeen is a city in Scotland and the US.

The fix?

The fix is very simple but not completely intuitive. You need to create a hierarchy, which Tableau should usually do automatically but this is not always the case. To make one right click one of the location dimensions and hover over "Hierarchy" and click "Create Hierarchy".

0:00
/

Once you've done this either drag all the necessary location dimensions into the hierarchy in actual order of the dataset, like so:

Now that there is a hierarchy, once you drag "City" onto a map in Tableau, it will automatically input the dimensions before city in the hierarchy which will allow Tableau to distinguish which specific city to show and will no longer leave Null values.

Fri 30 Sep 2022

Thu 29 Sep 2022

Wed 28 Sep 2022

Tue 27 Sep 2022