Step wise tableau tutorial: Animation with Page Shelf in Tableau
The blog is a humble effort to recreate the visual story shown by Hans Rosling in his memorable and highly popular 2006 TED talk . One of my friends urged me to view this talk and after seeing this video my interest towards data and visualization shot up. If anyone wants to master the art of story-telling with visualization than this video is a must watch. One can see the original visualization created by Hans Rosling and his team here.
Data
In this blog we are going to recreate the same visualization (as shown in the video/talk) to analyse how Life Expectancy in years (health) and GDP per capita (wealth) have changed over time in the world for various countries.
One can find the relevant data here or here (look for source data spread sheet icon in the visualization on the axis). We need following data for this exercise
- Life Expectancy in years
- Income per person (GDP/capita, PPP$ inflation-adjusted)
- Population, Total
- Regions of the World
Data Exploration and Analysis
Step 1 – Connect to GDP/Capita data
Open the Data worksheet from Excel file that has data for Income per person i.e. GDP/capita.

Tableau ’s data interpreter has detected potential issues with the structure of the data. First row actually represents the year as data in the file is arranged as cross-tab of Countries (Rows) against Years (Columns). Let us turn on the data interpreter.

Tableau Data interpreter rightly detected the first row as data headers and made the changes accordingly. In the process it also merged the row for country “Abkhazia” into header as it had null values for all the years. We will not worry about Abkhazia’s data loss as it never had data for any of the years (1800 to 2013). One can review the changes done by Tableau’s data interpreter. It generates a summary of changes with legends in the separate Excel workbook with original data.
Let us rename the first column and proceed ahead.

We will use Tableau’s pivot feature to convert the cross tab data into tabular format as shown below.
Select all the columns from 1800 to 2013 and right click à Pivot

Rename the columns to Year and GDP per Capita as shown below.

Step 2 – Connect to Life Expectancy data source
While connecting indicate to Tableau that the first row has field names in it.

Convert the cross tab into tabular format and rename the fields similar to what we did in step 1.

Step 3 – Connect to Population, Total data source
While connecting indicate to Tableau that the first row has field names in it.

Convert the cross tab into tabular format and rename the fields similar to what we did in step 1.

Step 4 – Connect to Country to Region mapping data source

Step 5 – Go to Sheet 1
You should 4 data sources that we have connected to from step 1 to step 4 as shown below.

Step 6 – Put GDP per Capita on Column Shelf

Step 7 – Put Life Expectancy on Row Shelf

Since we are using a different data source, Tableau expects us to define the relationship between the two data sources.
Establish Country and Year as link between the two data sources as shown below.
Go to Data à Edit Relationships

Tableau automatically detected relationship between primary and secondary data sources by matching column names. Review the relationship for all secondary data sources and click ok.

Step 8 – Put Country on Details Shelf to create Scatter plot

Step 9 – Put Total Population on Size Shelf

Step 10 – Put Region on Colour Shelf

Step 11 – Put Year (from Primary data source) on Pages Shelf

Step 12 – Format axis
Change the range for Life Expectancy axis as shown below.

Convert GDP Per Capita axis to logarithmic Scale set the range as shown below.

Step 13 – Change the Size of the bubbles

We have successfully created the visualization. Now adjust the Page Shelf settings such as speed, whether to show history, trail etc. as per your preferences and see the animation. One can convert this work into Dashboard for publishing purpose and for more options.
Below is the outcome (animated gif) of the steps performed above.

Stay tuned for more learning through visualization with Tableau.
About Tableau
Tableau (NYSE: DATA) headquartered in Seattle, Washington has a mission to help people see and understand data. It offers a product portfolio for data visualization focused on business intelligence.
One can visit the official Tableau website to find more details about Tableau and its product offering and features.
Comments