<< Back

How to create a grid map using Alteryx and Tableau?

The spatial tools in Alteryx allow the user to create powerful visualisation within Tableau such as creating a grid map, this highlights distribution within certain areas in a map and make it easier to identify locations within a map.

In this blog I’ll be using the squirrel data from MakeOver Monday to help you create a grid map. You can find here and follow along the steps I describe by just downloading the data set here

Once you have spatial data the first thing you’ll need to do is create your points using the Create Points Tool. This tools will create points as a spatial object for each X and Y coordinate, in this example this will be our Longitude and Latitude points. The great thing about this tool and Alteryx’s spatial tools is that this will let us output our data as a spatial file, which can be used in Tableau.

After creating your spatial points you’ll see you have a new column created called centroid, if you put the browse tool after this you’ll see a map with all of your points.

To build the grid layer we first need to create a shape file for the area that we want the grid to cover, in this example that’s central park. To achieve this we’ll be utilising the Poly-Build Tool.

The Poly-Build Tool will allows us to draw a polygon or a polyline – depending on what you’re trying to achieve. This will allow us to create our grid spatial layer. We will need to select the Convex Hull option: this will let us draw our polygon our source field is the points we want to draw from, which is the centroid field.

You should now see this:

Now we’re ready to create our grid and for this we’re going to use the Make Grid Tool! This tool as you can tell from the very intuitive name will take the spatial object and create a grid based on that for this example I set my grid size to 0.1. You will need to select the option of generate grid for each object and remember to tick clip to polygons. By checking that option we’re making sure the grid generate fit the boundary of our polygon.

Now we have our grid but we don’t have our data, so we have to bring that information back by using the Spatial Match Tool. Think of the spatial match as a join tool, it creates a relationship between the 2 sets of spatial objects based on the condition you’ve allocated. Our grid goes into the universe input and from the create points tool we’re going to join that stream to our target. The option we’re selecting is: “Where Target Intersects Universe”. In the Matched output we will only get squares that have data in them but if we want all the grids even those with no data we just union the matched and unmatched anchors.

Output your file as a shp. file and now you’re in Tableau.

Tableau is the easiest step of what you have to do:
In Tableau you’ll have a new field called geometry just double click that and tada you have your grid in Tableau, final step is to put grid name on details.

Soha Elghany

London, UK

Leave a Reply

Your email address will not be published. Required fields are marked *