Week 9: Density Map with Hexbins - Tableau | DS23

by Auguste Navickyte

Tableau has an easy way to create density maps - simply bring your coordinates (longitude and latitude) and/or other details into the view, and select "Density" on your Marks Card. However, if you want some more interactivity in your map, you can create one using a parameter and a Hexbin calculation. How do you do that?

1. Create a parameter that will work as your Hexbin Adjuster (see below)

2. Create two calculated fields for Hexbins X and Y as below:

HEXBINX([Longitude][Hexbin Adjuster],[Latitude][Hexbin Adjuster])
/
[Hexbin Adjuster]

and

HEXBINY([Longitude][Hexbin Adjuster],[Latitude][Hexbin Adjuster])
/
[Hexbin Adjuster]

3. Convert your Hexbin X calculation into a geographical field (longitude) and do the same for the Hexbin Y one (select latitude this time though!)

4. Double click on Hexbin X and Hexbin Y on your data pane, and they should appear onto columns and rows respectively

5. Colour your map based on a measure of your choice

6. Show the parameter so your user could choose hexbin size - see below how the view changed in my example based on different values for hexbins (1oo and 300)

Hopefully this helped!