Flight or network maps are great for displaying data in a unique way; they can be used to show the flow of goods, people, deliveries, etc. Within my current project, these maps are used to show FX flow between branches and clients and also to map the business flights of sales people.
Following on from this Tableau Online Help article, the data must be presented in a particular format in Tableau to create such a visualisation. Alteryx is the data preparation tool of choice for this post and the initial input is the following:
Flight details for sales people within Europe, including the fields Outbound and Destination, Ticket Price, Customer Name etc. The output of are Alteryx workflow will look like this:
This is how Tableau wants to consume the data. Each line on the Tableau viz has two lines of data attributed to it. The top two rows represent one line that is drawn from Stockholm to Oslo, The first row has the coordinates for Stockholm while the second row has the coordinated for Oslo.
Below is the workflow to create this table:
1 - Input data, in a similar format to that given above.
2 - Although Tableau automatically generates latitude and longitude for geographical elements such as cities and postcodes, in order to create a Network Map you must have the latitude and longitude within the data. For my example I am mapping cities. There is a great online recourse which has a large list of cities and there latitudes and longitudes. This input tool is just importing the cities file.
3 - Selecting just the City field, lat and long
4 - As you need the latitude and longitude for both Outbound and Destination cities I just rename the fields so Outbound is:
And the Destination is:
5 - Join the Outbound field in the Input Data to the Out.city field from the City Data
6 - Join the Destination field in the Input Data to the Des.city field from the City Data
7 - Summarize like the following:
It is possible to add in more fields depending on what you want to see in your final network map.
8 - Duplicate the following formulas
9 - Duplicate the following formulas
10 - Deselect Des.lat and Des.long
11 - Deselect Out.lat and Out.long
12 - In the Union manually configure the fields and align Out.lat and Des.lat and the same for longitude
13 - Save down the new file as a .tde, data should be in a similar format to the data in Figure 3.
Then to work the magic and create the visual seen at the beginning of this post, open up Tableau and the Tableau Online Help article and follow example 2.
To learn more about using Tableau and Alteryx for rapid data discovery and advanced predictive analytics, join our webinar on 6th September.