From WDI to Tableau

Some of my data analytic projects require data from The World Bank’s “World Development Indicators”. In order to simplify the process of getting the data from WDI to Tableau I have developed a procedure to execute the process.

Select relevant data from WDI

Select Countries, Series (Variables) and finally Years. After selecting Years you must select Search.

Download the resulting datatable to Excel

The datatable is now in the following form:

Country Name Series Name 2011 [YR2011] 2012 [YR2012]
Afghanistan Birth rate, crude (per 1,000 people) 36.556 35.254
Afghanistan Death rate, crude (per 1,000 people) 8.375 8.095
Albania Birth rate, crude (per 1,000 people) 12.651 12.756
Albania Death rate, crude (per 1,000 people) 6.71 6.812
Algeria Birth rate, crude (per 1,000 people) 24.658 24.579
Algeria Death rate, crude (per 1,000 people) 5.855 5.895

Clean the datatable

Shape the datatable with Tableau Excel Datashaper

The data is now in the following form:

Country Name Series Name Year Value
Afghanistan Birth rate, crude (per 1,000 people) 2011 [YR2011] 36.556
Afghanistan Birth rate, crude (per 1,000 people) 2012 [YR2012] 35.254
Afghanistan Death rate, crude (per 1,000 people) 2011 [YR2011] 8.375
Afghanistan Death rate, crude (per 1,000 people) 2012 [YR2012] 8.095
Albania Birth rate, crude (per 1,000 people) 2011 [YR2011] 12.651
Albania Birth rate, crude (per 1,000 people) 2012 [YR2012] 12.756
Albania Death rate, crude (per 1,000 people) 2011 [YR2011] 6.71
Albania Death rate, crude (per 1,000 people) 2012 [YR2012] 6.812
Algeria Birth rate, crude (per 1,000 people) 2011 [YR2011] 24.658
Algeria Birth rate, crude (per 1,000 people) 2012 [YR2012] 24.579
Algeria Death rate, crude (per 1,000 people) 2011 [YR2011] 5.855
Algeria Death rate, crude (per 1,000 people) 2012 [YR2012] 5.895

If you load the data into Tableau in this form and you want to  analyze and visualize the relationship between variables you must transform the data inside Tableau. If you want to avoid this you can pivot the table before loading it into Tableau. After pivoting the table has the following form:

Country Name Year Birth Rate Death Rate
Afghanistan 2011 [YR2011] 36.556 8.375
Afghanistan 2012 [YR2012] 35.254 8.095
Albania 2011 [YR2011] 12.651 6.71
Albania 2012 [YR2012] 12.756 6.812
Algeria 2011 [YR2011] 24.658 5.855
Algeria 2012 [YR2012] 24.579 5.895

This is the most convenient form but if the datatable is large it may not be possible to pivot it inside Excel. The maximum number of columns is 256.

 

When I have loaded a datatable from World Development Indicators to a Tableau source file in the above most convenient form, I sometimes find that an additional Series is required. I can then add it in the following way:

-Open the World Development Indicators Databank

-Select the Countries that are in the Tableau datasource, the Series that is required and the Years that are in the datasource

-Download the resulting table to Excel

-Datashape the table with Tableau Excel Datashaper

-Change the column names as necessary

-Copy the Series column

-Paste the Series column to the Tableau Data Source

-Refresh the Data Source in the Tableau Workbook

-Make necessary changes to the Workbook

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *