MakePoint and MakeLine in Tableau

by Tom Prowse

With the new release of Tableau, there have been a lot of new features to get everyone excited. Parameter Actions and Vector Maps seem to be getting a lot of the attention (and rightly so!) but Tableau have also released a feature which allows you to create points on a map using a X and a Y from a flat file… but also create a line between each of those points!

In this example, I am going to use data about Premier League football stadiums, which can be downloaded from Doogal, and I have limited this just to three of Liverpool’s fixtures as seen below:

MakePoint

Using a calculated field to create a point, you can transform the X and Y’s into points on a map. By creating the following calculated fields, we will then be able to map all of the stadium’s on a map:

Create Home Point
Create Away Point

We can then bring either the home or away points into the view to create the following:

Home Points

Away Points

MakeLine

Now that we have all of the points on the map, we can now create a line between each of the points, showing a path between them. This is again done by creating a calculated field, but instead of using the MakePoint, we will use the MakeLine feature.

The syntax for the MakeLine is very simple, it is just –

MakeLine([Start Point],[End Point])

Using the example from earlier, we can just replace the start and end points, with our Home and Away points, creating following:

We can then bring this into our view and our Home and Away points are then joined by a path, as easy as that!

This is a very simple example and a good introduction to the new MakeLine and MakePoint features which seem to be very straight forward.

I have recently taken this a step further by combining this feature with Parameter Actions to create a visualisation on how far each Premier League team had to travel last season. The viz can be seen on my Tableau Public page so go check it out!

Avatar

Tom Prowse

Thu 20 Jun 2019

Wed 19 Jun 2019

Mon 17 Jun 2019