Generating a Heat Map in Alteryx and Visualising in Tableau

by Joselito Bondoc

The Heat Map tool generates a set of polygon objects which represent different levels of heat in a given area. This is extremely helpful in trying to visualising individual points as generalised hot spots. In this post, I'll be using a data set on crimes in London and visualise the number of crimes reported using a heat map.

Figure a. Alteryx workflow creating a heat map to use in Tableau

The first step in creating our heat map is by using the Create Points tool in the Spatial category and for this tool, we need one column for Latitude and one column for Longitude. This tool then create a point (centroid object) for each reported crime (figure b).

Figure b. Output of Create Points tool

Filter is used to remove any null records in the Centroid column, doing this prevents an error from occuring when trying to use the Heat Map tool later on.

Another problem I encountered with the London crimes dataset is that it had records for crimes outside London, so in order to filter these out, I used another dataset which was a spatial file containing London boroughs. I then used the Spatial Match tool to find the intersects of the Centroids (points from crimes dataset) with the Polygons (London boroughs), which then caused the crime records from outside London to output in the unmatched anchor of the Spatial Match tool. In figure c, we can see the result of this match, only points for crimes in London are shown on the map.

Figure c. Output from the Spatial Match tool. Each point is a reported crime (red). Underneat the points is the polygon object for each borough (green).

The next step is to visualise these individual points as general hot spots on a heatmap. This is where we can use the Heat Map tool.

Figure d. Questions tab of the configuration pane to adjust the specificity of the heat map.

The tool divides the map into grid cells and allocates a heat level for each cell. The Questions tab of the configuration pane allows us to modify the specificity of our heat map (figure d).

  • Grid size: A smaller grid size produces a more detailed map but it means the process will take longer to run.
  • Maximum distance: The maximum distance at which one cell can contribute to the final heat level of another cell.
  • Decay function: Determines how much heat a cell gets from heat sources not directly inside the cell and further than the maximum distance.
  • Smooth results: Selecting this option straightens the edges and rounds the corners of our heat map.
  • Output type: Donut produces non-overlapping polygons with their own single heat level. Stacked produces polygons that overlap, containing their own heat level as well as higher levels.
Figure e. The input tab of the configuration pane.
  • Choose field: Point: This is a required field to configure, we need to select the spatial object field that contains the points we want to use as heat sources.
  • Choose field: Heat: This is an optional field, which can be used to specifiy the heat level of points.

Using the configuration seen in figure d and e, the output of this heat map tool is shown below (figure f). On the left, we can see the visualisation of the heat map polygons and the results pane on the right shows that we have 6 different polygons with their own heat levels.

Figure f. Output from the heat map tool.

The visualisation of this heatmap isn't the best in Alteryx (figure f), so instead we can visualise this in Tableau (figure g). We can move the polygon object onto detail, split them up and colour by the tile name. From this visualisation, we can see that more crimes (higher heat levels) are reported in central London and as you move further outside, there are less crimes reported.

Figure g. Visualising the polygon objects from the heat map tool. 

There we have it! That's how you can create a heat map in Alteryx and then use Tableau to visualise those polygons.

Thumbnail from Timo Wielink on Unsplash.