In this post, Jeff Knezovich explains how to create interactive dashboards with Tableau Public. It is part of a series of posts on How to develop Data Visualisations for think tanks
For our visualisations, our how tos have mainly focused on maps. But we know visualisation goes much beyond that. There are various types of charts that might be useful when it comes to visualising data.
And one of the strengths of using a programme like Tableau Public is that it can pull various visualisations together into a single interactive dashboard. This how to will explain how that can work, using our DFID 2011 flight data.
Step 1: Download and install Tableau Public and create an account
If you haven’t done so already, download and install Tableau Public on your computer. As part of the that process, and in order to save and share your visualisations, you will also need to create an account. You’ll be required to enter your email address to download the programme.
It’s worth noting that, if you have already installed Tableau Public but haven’t updated it in a while, at the beginning of April Tableau 9 was introduced. It might, therefore, be worth installing the most current version.
Step 2: Connect data source
After opening the programme, the first thing you’ll need to do is to connect to data. Click the icon that looks like a battery (I think it’s supposed to represent a server stack, but your guess is as good as mine) with a plus sign on the bottom. A dropdown menu will appear. In Tableau Public, you can only connect to offline datasources, like an Excel spreadsheet. With the paid version, it is possible to connect to dynamic data.
In this case, we’ll work with an Excel spreadsheet. We’re using the same data as before: DFID flights in 2011, which is available to download as a Google Spreadsheet.
Once we select the appropriate sheet, click the worksheet tab in the bottom-left corner to start exploring your data!
Step 3: Move ‘pills’ to rows and columns to develop new charts and tables
The first thing we might like to visualise is the number of times DFID staff travelled to various countries in 2011. We already know this from PivotTables, but this is only going to be one part of our dashboard.
The thing to know about Tableau is that it’s designed to be a ‘drag and drop’ interface. Different measures and dimensions in the left sidebar can be dragged directly into columns or rows, but also to change colours or sizes. When they are dragged into these fields, they take the shape of a stretched oval, which is why they are known as ‘pills’.
Let’s start by dragging our dimension ‘Dest Country’ into the rows. It creates a table automatically that is not dissimilar to a PivotTable. To get a count of the number of visits to each of these countries, we can drag the same measure, ‘Dest Country’, into the columns field. It creates a table that we don’t want.
But never fear! That’s because it’s treating it as a ‘dimension’ (i.e. discrete categories, like Afghanistan and Bangladesh) rather than as a measure. If we click the ‘Dest Country’ pill in the column field a dropdown menu appears and we can change it to a count of the measures.
This will create a bar chart, which we can sort descending by clicking on the ‘Sort descending’ button on the row of buttons on top of the page.
You’ll also notice that in the ‘Show me’ menu there are a number of different types of charts available. By clicking the one in the top-left corner, we get a table, which is how I will leave this for now, as we just want an overview in the dashboard we’re going to create.
Step 4: Create a sheet that can act as a filter
One of the nice things about the dashboards, is that individual sheets will be able to interact. One of the ways this is possible is through filtering.
Because this dataset contains a lot of information about countries, we can map the countries and then use that as a filter in the dashboard.
To do this, drag the ‘Dest Country’ dimension into the columns field. Select the filled map icon in the ‘Show me’ dropdown.
We can then use this to create a choropleth, or heat, map. For example, maybe we want to know which country cost the most on average to travel to.
If we drag the measure ‘Cost of Booking…’ onto the ‘Color’ shelf, the map changes colour to reflect how much DFID spent on travelling to each country.
But this is the total spend. It might make more sense to change it for visualisation purposes to the average spent per country. To do this, we select the ‘Sum(Cost of Booking) pill’ and in the dropdown menu we change it from sum to average.
The result is a map that shows Mali as one of the most expensive places to get to.
There is some oddity in the data. It appears that someone refunded a trip to Colombia, and maybe that happened across financial years. So let’s exclude that. Simply click on Colombia and then select ‘Exclude’ to tidy up the map.
Step 5: Create an interactive dashboard
At the bottom of the sheet, instead of creating a new sheet, select the button for creating a new dashboard.
You’ll see that instead of individual variables in the left sidebar of a dashboard, we have the sheets. Let’s simply drag sheet one onto the page and then sheet two below it.
Then, select ‘Sheet 2’ and a grey border will appear. Select the little down arrow on the top-right corner and a dropdown menu will appear. Select ‘Use as filter’. Now, if you select a country, it changes the chart at top to display only that country.
As it stands, it’s not the prettiest of dashboards. But with a bit of tidying, and adding some more dimensions it has the potential!