Pathway to your first live Dashboard with Tableau

Kanishka Randunu
Analytics Vidhya
Published in
8 min readApr 26, 2020

What is a Dashboard ? and What is Tableau ?

Let me start with these 2 small questions that may have crossed your mind while reading the title of this article.

A data dashboard is an information management tool that visually tracks, analyzes and displays key performance indicators (KPI), metrics and key data points to monitor the health of a business, department or some specific process.

Tableau is a powerful, secure, and flexible end-to-end analytics and a business intelligence platform that turns data into insights that drive action.

You will feel bored if you are only planning on reading this. But if you are following these steps with me, you will have a nice dashboard at the end of this article. This article will be mainly focused on 1. Connecting a live data source to tableau 2. Including a map view in Tableau 3. Creating charts on tableau sheets 4. Using tableau calculations 5.Finalizing and publishing the live dashboard. Before jumping into these sections, my advice for a successful dashboard will be,

“You have to work on your data set first. Data should be from a reliable source. Data should be accurate and complete. Data should match with the final outcome you want to showcase in a dashboard”.

1. Connecting a live data source to tableau

Tableau desktop version is not a free software. However you can download the free 14 days trial from the tableau official website. If you are a student or an academic, you can request a free tableau version by submitting the relevant details to tableau. Opening tableau for the 1st time will give you the following screen.

Tableau allows you to connect data sources from many platforms as seen in the above snapshot. For this, I am going to import data from a google sheet which is being updated hourly.

How to get a google sheet to get updated hourly ? Okey ! This is how I did that.

First I had to find a data set which is getting updated lively. I could easily find this COVID-19 dataset which is getting lively updated. All I had to do was to update that into a google spreadsheet which I can use to join with Tableau.

Dataset link : https://opendata.ecdc.europa.eu/covid19/casedistribution/csv

Step 1: Login to your google account (you have to use the same account for tableau also) and open a new spreadsheet.
Step 2 : Copy the above mentioned dataset link
Step 3 : Write the following equation in the A1 cell of the opened spreadsheet.

=IMPORTDATA(“https://opendata.ecdc.europa.eu/covid19/casedistribution/csv")

This will import data from the above web link to your google spreadsheet. And as per the record by google, this function will automatically update your sheet hourly ! Save this spreadsheet. I saved this sheet as “Covid Data”

Step 4 : Open tableau > Connect > Google Sheet. This will open a new window for you to enter your google account details. Allow tableau to access your google sheets. Then close the window.
Step 5 : Tableau will now have a window showing all the spreadsheets for the above given google account. Select “Covid Data” spreadsheet from the window and it will load all the data available to Tableau. After the data set is loaded, you can directly use Tableau to hide unwanted data fields, Convert data types to continuous or discrete, cleanse the data set etc.
* Right Click on the data field name > Hide

2. Including a map view in Tableau

You will find 3 small icons with ‘+’ sign in the area that I have highlighted in the above snap. First + mark is to open a new sheet. The 2nd + mark is to open a new dashboard. 3rd one is to open a new story. Dashboard is a collection of some separate sheets. Therefore we will first create separate visualizations on sheets and then assemble them into one dashboard.

The new worksheet will have a pane visible on to the left side of the screen where it will include Dimensions and Measures of the imported data set. Write click on any dimension or a measure, to change the data type, rename. remove etc. What I am trying in this section is to include a visualization in a world map to showcase country wise Cases and Deaths. I will include the steps followed by me in every section to keep this article short and sweet.

Step 1 : Convert day, month and year fields from continuous to discrete.
Step 2 : Rename “countriesAndTerritories” as “Countries” and change the data type as we are going to use this field to map the countries in the Map. Right click on “Countries” > Geographic Role > Country/ Region.
Step 3 : Double click on Latitude (generated), Double click on Longitude (generated). This will automatically load you a map view in the current Tableau sheet.
Step 4 : Drag “Countries” field to the“Detail” box in the following figure. That will plot all the countries available in the dataset in the loaded map. (As Dots)
Step 5 : Drag “Deaths” measure to the “Size” box to plot the country wise death count and to resize (size of the Dot) the visualization according to the death count. Click on “Size” box and drag the appearing bar to change the size of the plot.
Step 6 : Drag “Deaths” measure to the “Label” box to show the number of deaths appearing near the country.
Step 7 : Drag “Deaths” measure to “Color” box to color the plot by the death count (Countries with higher death counts will show a darker color).
Step 8 : Go to Map tab on the top of the screen. Map > Background Maps > Dark, to select a dark theme for the map.
Step 9 : 9 is bad so I am not going to describe it here. Hint : I used the “Tooltip” box to create the “7 deaths in Sri_Lanka” label to appear when the cursor is moved over a country in the map. Yah ! I know that it is cool (Not the death count, but the tool to display it when cursor is moved over a country). Trying this on your own will be much cooler !!

Panel with boxes to drag data and the final map view

3. Creating charts on tableau sheets

So now I am going to visualize the top 10 countries by death counts. Grab my hand. I’ll lead you on this journey !

Step 1 : Open a new sheet. Rename the sheet. Drag “Countries” to “Rows” and double click on “Deaths”.
Step 2 : Click the “Show me” tab on the upper left corner on the screen. Select the bar chart.
Step 3 : Right click on the “Countries” field. Create > Set > Top > By Field > “Top 10, by, Death ,Sum”. Rename the “Set 1” name to “Top 10 Countries”.
Step 4 : Sets will appear to the left lower side on the screen. Drag “Top 10 Countries” set to “Filters”. This will only give the top 10 countries. Then sort the countries in ascending or descending order. How to sort ? That was intentionally done by me, so you can google it !
Step 5 : On the top middle section you will find a box with the label “Standard”. Click on it and select “Entire view”. So the bar graph will use the whole sheet for the graph.
Step 6 : Put Some Styles. Make the colors, font size, title etc more stylish. Not going to mention those here. But there are more than enough sources on the internet where you can find these. This is what I got. You can do better !
Step 7 : Repeat this for “Cases”
Step 8 : Use the date field and create a daily trend for “Cases” and “Deaths”

Top 10 Countries by Deaths and Cases

4. Using tableau calculations

Are you familiar with excel sheet calculations ? Tableau calculations are much similar to those calculations. I will describe how to get total cases, so you can work on other sheets.

Step 1 : Drag “Cases” to “Text” box. Click on “Text”. Arrange the text sizes, Color, Alignment. Change “Standard view” to “Entire View” as before. Do some styling to the background colors.
Step 2 : Duplicate the sheet and change the relevant field to show “Deaths”.
Step 3 : Calculate the mortality rate. On the left upper corner near “Dimensions” you will find a small arrow head pointing downwards. Click on that and select “Create Calculated Field”. A box will appear and type the following calculation inside the box.

SUM([Deaths])/ SUM([Cases])

Step 4 : Rename the window (default as calculation 1) as mortality rate. Open a new sheet and create the view for mortality rate as followed above.

5.Finalizing and publishing the live dashboard

After finalizing all the views as sheets, now we need to create the dashboard. Click on the 2nd + sign in the left lower corner to open a new dashboard. There you will find all the sheets created by you. You can drag and drop those sheets as “Tiles” or “Floating” to create the final dashboard.

Finally, click on the “Server” tab > Tableau Public > Save to Tableau Public. You will have to create a tableau account by giving your google account details. Login to tableau and now your live dashboard will be available on tableau public site ! Cheers !!

My Dashboard link : Click here

Reference : Click here

--

--

Kanishka Randunu
Analytics Vidhya

Data Visualization Specialist | Business Intelligence | Visual Storyteller | Data Science Enthusiast !