## Tableau: Simultaneous continuous and discrete colour schemes

by Brian Scally

Today we did Tableau essentials training with Andy. Although I felt like I had a decent foundation in Tableau from the DS application and interview process, I was genuinely surprised by the number of basic features I had missed out on (and by how many unnecessary workarounds and table calcs I had conjured up as a result). Some of them enabled me to go back and improve bits of a viz I had uploaded to Tableau Public, which I will talk about now!

Here’s a worksheet of the viz in question:

I’m visualising the population change in the counties of Ireland after the famine in the 1840’s. Dublin was the only county to experience a population increase in population after the famine. I wanted to preserve the continuous shading of the counties by the level of population decline, but wanted Dublin to be in a completely different colour category. Tableau doesn’t allow you to use continuous and discrete colour schemes simultaneously. However, using a dual axis for the map can solve the problem. Here’s how it’s done.

Create a second map by dragging another instance of latitude or longitude onto the rows or columns shelf like so:

On the Marks pane of the second map, get rid of the current colour palette.

Now we require a really simple calculated field to select only Dublin from the new map. The following calc returns a Boolean value (True/False), which is ‘True’ if the county is Dublin, and ‘False’ if not.

Drag this new calculation onto the Colour mark of the second map. We can see that this has applied a discrete colour scheme to our True and False values, therefore isolating Dublin.

We can hide every county but Dublin, by right clicking the ‘False’ category in the colour marks card.

All our blue counties are gone, fantastic.

Lastly, right click on the green latitude pill for the new map, and select Dual Axis. This will overlay the second map on the first, keeping Dublin nice and orange.

And there it is. It’s one way of having a discrete and continuous colour scheme on the same map.

Brian Scally

Wed 27 Feb 2019

Tue 26 Feb 2019