Following on from yesterday’s theme, today’s challenge is to prepare a dashboard using only Tableau Prep and Tableau. The data sets come from the World Bank Open Data website. I started the day by first deciding on a preliminary objective. This was important to avoid being overwhelmed by the voluminous data sets available on the website. Having decided on analysing demographics and energy usage across different countries, I started looking through the metadata and downloaded additional datasets as required.
Data Prep in Tableau Prep
A sample of typical World Bank data sets is as follows:
Note that the time field (in this case, years) appears as separate columns, whereas the variables of interest are in a column called “Series Name”. If subsequent data sets have varying number of years of available data, there will be problems with joining or union-ing these data sets. Further complicating this is the fact that different data sets have different number of countries. Before joining the disparate data sets, I had to find a way to first standardise the data.
To start, I chose the data set with the earliest year and input this into Tableau Prep. Next, I pivot the columns containing Years to rows. I followed this with a second pivot on the “Series Name” and the new “Series Value” column. These contain all the measure names and values. In contrast to the first pivot, the second pivot transforms the rows to columns. A snapshot of part of the workflow in Tableau Prep is provided below:
Troubleshooting in Tableau Prep
I find that Tableau Prep is very useful when trying to quickly troubleshoot data quality issues. If a user wants to know if a “null” value should be excluded from the data set, there is a convenient way to check this. Clicking on the null under each column header reveals what rows have the nulls. The user can then look through the other columns to decide if it makes sense to exclude these rows. I used this feature to find that rows containing metadata in the original excel file were responsible for “null” fields values. A snapshot of this is provided below:
My final viz can be found on my Tableau Public profile. Due to time limitations, I have presented only demographics and energy use over time. Nevertheless, I plan to revisit this project as there are other angles to explore the data.