Animated Visualization using Tableau

What you see is what you perceive ~ Visualization

Introduction

Visualization is one of an integral part in Data Science, you have to have a complete idea of the data you working on in and out. Visualization is a technique wherein you can visually interpret numeric data in the form of shapes usually by plotting them to get box-plots, scattered plots, pie-charts, density charts, histograms, etc. You can visualize data in many ways possible but the end result should be understanding the data in hands. Once you have a complete idea of what data is your analysis become certainly easier.

So how do you perform visualization in data science? Answer to this is there many ways of going about it, you can write a few lines of codes in any language of your choice to plot the data or you can use various GUI based software that can help you plot the data based on the data fields. And one such software known as the best Business Intelligence (BI) software of recent times used very widely across the world is Tableau. With the ease of just the names of data fields, you can plot your data in numerous ways possible using GUI of Tableau. You can get rid-off those listings that can be time-consuming by deploying a very powerful tool which is Tableau. Tableau possesses an extensively varied application and uses, the more you use it the better you are equipped with it to do the best of the visualizations with just a few clicks.

Visualization of your data is very preliminary steps in your data analysis. You visualize data first to understand what is going on with the data and what are the inter-relations between the data fields. Once you visualize your data you can better prepare your data keeping in mind what is important and what is not thus limiting your data to just what you want to get out off. This is very very important step these days simply because we have a very high volume of data in this data-driven world and it is important that we filter our data to a limit so that we can get the best out the analysis and can bet upon our findings!

The Software

Addressing the elephant in the room, the software deployed is ‘Tableau’. You can easily download paid, free or student version of Tableau depending upon your preferences. This is the official site for getting Tableau downloaded:

https://www.tableau.com/

So get your best-suited Tableau desktop ready as we are now going to visualize a world demographic data in an animated way using Tableau!

Aim

At the end of this read, you should be comfortable with forming animated visualization using Tableau. We will be looking at the change in the world demographics from 1960 to 2013 with respect to population, fertility rate and life expectancy in a 5-dimensional animated visualization.

Data

There are four data files used for this visualization which are as follows:

  1. Country_Data – contains fields like region, country name, country code etc.
  2. Fertility-Rate – contains fertility rate of all the countries from 1960 to 2013
  3. Life-Expectancy – contains life expectancy data of all the countries from 1960 to 2013
  4. Population – contain population data of all countries from 1960 to 2013

Below are the links serially as above to download these datasets:

  1. https://talktomedata.files.wordpress.com/2019/07/country_data.xls
  2. https://talktomedata.files.wordpress.com/2019/07/fertility-rate.xls
  3. https://talktomedata.files.wordpress.com/2019/07/life-expectancy.xls
  4. https://talktomedata.files.wordpress.com/2019/07/population.xls

Once you have downloaded the files and Tableau you are ready to get started with this animation visualization.

Blog Vlog

This blog is very different as mentioned Tableau is GUI based software it does not have listings or coding lines which is possible to explain line by line over here. Thus, to give a better understanding and working this visualization out we have broken down entire processes into various steps with videos explaining how you can go about those things. Get ready for the very first vlog from The Datum.

Loading Data into Tableau and Preparing

The very first step in any data analysis i.e. loading data into the respective environment (here Tableau) and preparing it to perform analysis. Here in this very first video below shows how we connect our excel file data with Tableau and further pivot the years of Fertility_Rate, Population, and Life_Expectancy. To answer the question why do we pivot data? since the data is more than 40 years pivot summarizes data by aggregating it thus making it very easy to form visualization.

Video link to loading and preparing data in Tableau

Linking relationships in Data Files

As we all know by now there are 4 different data files and they have to be linked to each other with a unique data field which is common across all the data sets. We need to create relationships among the files so that they are linked to at least one common data field across all the data sets. And this can be done in ‘Edit Relationships’ in Tableau. You can select any of the data set as primary I have selected Population data set as primary and for relations, I have customized the relations only limiting Country Code and Years. I have only limited to country code firstly because of it the unique identifier for all the countries and years because what we are plotting here is the timeline of 40 years of demographics hence becomes important to link relationship of years. Below is the video explains all stated above!

Video showing editing relationships between different data sets by customizing

Forming Visualization

Now it is finally time to prepare our visualization which we are expecting. As I mentioned earlier Tableau works on GUI and no need to code anything. We just need to drag and drop data fields in respective markers to get the visualization. Below is the listing for entire drag and drop of the data fields in the following markers:

  • PopulationSize
  • Country NameDetail
  • Region – Color
  • Fertility Rate Columns
  • Life Expectancy – Rows
  • Years – Filters (this is temporary because data is summed up and x-axis and y-axis will show very big values to adjust them we put the years in filters and customize to limit to year 1960. This will normalize the scale as expected)

Further, we do little adjustments with respect to shapes, sizes and other characteristics of the bubbles formed which can be easily demonstrated using the video below. The video below shows the entire processes of forming the visualization.

This video shows how to form visualization

Adding Animation using Pages

Now, the final step which will do all the workings of Animation. Tableau posses a field known as Pages. This field takes care of all the animation visualization done in Tableau. We just need to add the data field with respect to which we need the animation to be since here we want to have a view of world demographics change from 1960 to 2013 we have to add data field Years in the pages field which will form the animations. Once formed it adds additional control box from which you can control the animations. There is also an interesting part to it, in the animation control you can check to box the ‘history’ which will let you see the trend limiting to the country selected leaving markers behind as the animation progresses. Also, lastly to make it a deliverable a few changes with respect to how to add the names are been added to our animation graph (forming data visualized dashboard) which is self-explanatory in the video. Below is the video which demonstrates how to add and go about animations in Tableau.

Final Animation in Tableau using Pages

Conclusion

As I mentioned at the end of this article one should be comfortable with forming 5 – dimensional animated visualization using Tableau the 5 dimensions are as follows:

  1. X axis indicates Fertility_Rate
  2. Y axis indicates Life_Expectancy
  3. Population is indicated by the increasing sizes of respective country bubbles from 1960 – 2013
  4. Different regions of earth are indicated using colors
  5. And last but not the least the time frame showing from 1960 to 2013 is itself a time dimension

Key Takeaways of Visualization

  1. Visualized data is processed faster i.e. one can better understand data if seeing visually rather than actually finding out data relationships
  2. Data Visualized dashboards are very easy to understand and helps you quickly retain the long term visualized memory
  3. Data visualization reports can help you find data insights which might not be feasible in traditional type of reports
  4. Data visualization will leave you with actionable items that is it will help you figure out what is important in your data and what needs to be focused on instead of moving ahead with piles of data
  5. Data visualization lastly increases productivity as once visualized one can set clear goals what needs to be achieved at the end of the analysis

End Note

Today, Datum is giving you another powerful angle of Data Science which is Data Visualization. A very powerful and handy procedure performed as the very first step in data analysis. The motivation for the Datum to come out each week and give you such powerful tools is only your love and support. With the continuous support being received from you all across the globe is what keeps us going and delivering something significant each week. If this was helpful and got real/practical data science algorithms please subscribe to The Datum, like it and share it so that others can also be helped!

Multiple Datum’s form Data, mindless Data can do wonders.

Mindful you and me together can do magic!

Have a great week all of you, Happy Independence Day to everyone here in the United States. Cheers!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s