Alteryx: Calculate The Distance Between Two Points

by Skomantas Tamulaitis

Alteryx name originates from the phrase “Alter Y and X”. That is not surprising since the software was originally created to do spatial analysis. In this blog I will show you how to calculate the distance between two points on a map.


Step 1

First, we need two points in space. To get it, I simply googled the longitude and latitude of two cities that host Alteryx and Tableau conferences this week, Denver and Las Vegas, and put those numbers into text input.

Step 2

In order to create a single point on the map using longitude and latitude you need to use a green “Create Points” tool from the “Spatial” tab. Here you want to specify which field refers to longitude and latitude and leave everything else at default values. It will create a new column called “Centroid” which refers to the two points in space.



Step 3

To see where those points lie on the map add a browse tool at the end. From a drop down menu at the top of the configuration window select what kind of map you would like to use for the background. Here I selected “Alteryx Light – Most Recent Vintage”.

Step 4

Now you need to draw a line connecting these two cities. Drag “Poly-Build” tool onto the workflow and change the “Build Method:” to “Sequence Polyline”. Leave other configurations at default values and press run.

Your browse tool will now display a line connecting Denver with Las Vegas.

Step 5

Drag “Spatial Info” tool in and tick the box for “Length (Miles)”. This tool can provide different summary information about your spatial objects. If you press run a new column will appear showing that the length of the line is 609 miles. Congrats, you have just calculated a straight line distance between Las Vegas and Denver!

Avatar

Skomantas Tamulaitis