Tableau: A Step-by-Step Process in Decrypting the Data Monster
Tags: Technical, Data Cleaning, Mindset, Data Science, Data Visualization

Tableau: A Step-by-Step Process in Decrypting the Data Monster

From data-scrubbing to visualization

It was mid-August of last year when I first tried my hand at Tableau. What started out as confusion and intermittent grousing at having to learn something completely new from scratch when I could just crunch data and churn out graphs from Excel weeks later, turned into an epiphany when I realised how mindbendingly intuitive the data blending and representation process was. Not only could I scrub thousands of cells worth of uncleaned data within a few clicks, but my graphs came to live and could tell the same story to its viewers on the same page. After 6 months of initial struggle, I am thoroughly convinced about its benefits, and have managed to successfully transfer almost all of my data operations to Tableau.

What throws most people off the curve is how sparse the functions look when they first open a spreadsheet on Tableau. Unlike Excel, which has a wide dearth of operations ranging from sorting and filtering, table formatting and merging explicitly displayed on the toolbar, Tableau seems to have virtually, nothing, when you first start. There is however, a way to break through this silent perplexity.

Click on Connect > Microsoft Excel and then drag the spreadsheet that you want onto the main page (if you have multiple spreadsheets).

In order to get rid of the blank cells, click on the Add Filter function located at the top right hand corner of the page. Select a calculated field of your choice and then choose a range of values that you would like to explore. Exclude null values if you wish to eliminate the empty cells.

Repeat this process for the other fields and then click on the Data Interpreter option to help you clean your spreadsheet one more time.

Combining Multiple Spreadsheets Together

If, however, you wish to merge more than one spreadsheet together, you will need to create a common one-to-one function to match the range of one dataset to the domain of another. Say, for example, you intend to insert a column on percentage change in GDP into a pre-existing World Happiness data sheet. You would first, convert the GDP spreadsheet into a pivot table (string form). This can be done by clicking on the columns, then right-clicking Pivot.

Make sure that all the variables correspond to each other in field type (eg. if the year in the World Happiness Report is registered as a Number (whole), make sure the year on the GDP % growth data is represented as a Number (whole) as well). Any mismatch of functions will hinder the merging of both data.

Next, upload the other dataset onto Tableau. Create main clause “Country Name”, then add joint clause “Year”. The GDP % change dataset has been successfully incorporated into the World Happiness dataset.

Data Visualization: Creating a Multiple Plot Story on the Same Page

Now that you have finished processing the data, what next? You create visuals. One of the most unique selling points of Tableau is that it allows you to, through a dashboard, explore different variables and incorporate different types of graphs so as to connect a big idea together. Let’s say that you are interested to find out the relationship between log GDP per capita and inflation rate with the overall happiness of a country. You will need to create 3 visualisations, the first two being a general trend between log GDP per capita and the rate of inflation against happiness to find out if such a correlation exists in the first place, and the third being a geographic map that connects all 3 variables together so that you are better able to see :

the combined effect of GDP and inflation and its effect on happiness if there is a geographic pattern between the countries and these 3 variables.

Given that you have paired numerical data between two variables (% GDP change and happiness), and that you are trying to identify the relationship between both to see if log GDP per capita, and by extension the magnitude of national income distribution, is a major cause of happiness, it is best to use a scatterplot to illustrate the correlation.

After sorting (Log GDP per capita) into COLUMN and (Life Ladder) into ROW, click on Analytics > Trend Line to obtain the line of best-fit as well as its correlation coefficient.

You can either continue to use a scatterplot diagram again for rate of inflation against happiness, or, to switch things up, use a bubble chart.

To combine all 3 variables together onto a single map, we need to create two different types of maps, a filler geographic map and a symbol map. Let’s start off by mapping log GDP per capita to the life ladder, click on Map under Marks and Colour for Log GDP per capita (the darker the colour, the higher the log GDP per capita).

Next, drag the Longitude (generated) option from the Measures sidebar onto Columns to create a duplicate of this graph.

Then, swap out the Log GDP per capita function at the lower longitude bar out for Inflation (% consumer prices).

Next, use a different type of geographical representation (in this case, circle) for the inflation geodata. Change the colour of the circles to one that is in contrast to blue for better visualization.

Lastly, right-click Dual Axis to interlay the second map with the first.

Finally, create a dashboard to connect all 3 ideas together!

Despite having gone through several visualisations, it is worth noting that these graphical representations are just but a fraction of what Tableau can do. You can also use stacked bar graphs, area charts, treemaps and waterfall charts to help you in your data depiction. I would love to go through the process of creating these maps with you in detail, but the set of data that we are presented with renders them unsuitable. This brings me to my final point on how data visualization is a delicate balance between art and science — it requires both discretion and intuition to select the appropriate type of visual representation, and transform it into something that it both readable and aesthetically pleasing to the eyes of the reader.

I hope that you have learnt something from reading this article, and I wish you all the best in your journey with Tableau.