Friday, January 16, 2015

Using the Path Shelf in Tableau (Step by Step Tutorial)

Charles Minard's graphic of Napoleon's march into Russia is considered to be one of the greatest statistical drawings ever created. The visualization was revolutionary in its ability to not only show the trajectory of Napoleon’s army, but also the diminishing size of the army over time as it marched into Russia and retreated. Below is an image of Minard's graphic.
















Using the Path shelf in Tableau, we can quickly create visualizations which draw paths from various locations on a map, as well as show the change in magnitude of a measure along that path. We will learn about the Path shelf using a simple example with fictitious data on bike races.

Download the data
Download the Excel file "Bike Races.xlsx". The file is available hereBike Races.xlsx

Connect to the data
Set up the data connection to the .csv file in Tableau.

Step 1
Open Tableau Desktop and connect to the data source by clicking Connect to Data.






Step 2
Under the In a File category, select Text File. Locate the Excel file and select Open.















Step 3.1
On the data connection page, drag sheet Sheet1 onto the data connection window reading Drag sheets here

Notice how the data is laid out. Each event is grouped by the name, each city is given a checkpoint number for that event, and each checkpoint per event contains a count. The count signifies the number of participants that made it to the checkpoint.

















Step 3.2
Click Go to Worksheet.

Build the first view
Now that you have your data source set up, begin building the view.

Step 1
Double-click Latitude In the Measures pane.
Double-click Longitude in the Measures pane.

Step 2
Double-click City in the Dimensions pane.

Step 3
In the Marks card, change the mark type from Automatic to be a Line

The view looks like this.



















Step 4
Drag Checkpoint from the Measures pane onto the Path shelf to indicate the order the cities should be connected.

















Step 5
Drag Event from the Dimensions pane onto the Color shelf to separate the events in the view by color. 

Step 6
To prevent grouping the events in the view by State, right-click the State field in the Marks card and select Remove.


















Step 7
Now that the events are all displaying the correct checkpoint path, demonstrate the changing size of participants by dragging Count onto the Size shelf. Increase the size of the paths by clicking on the shelf and dragging the slider up.

Step 8
Drag Event from Dimensions onto the Label shelf.

The final view looks like this.


















We now have a good idea of what path participants took throughout the bike race as well as how the participant count changed over the course of the races.

No comments:

Post a Comment