Basic Tableau How-To
This is a readable version of a presentation I gave recently about Tableau basics: building a bar chart and a line chart.
First Up: Bar Chart!
The following are steps to downloading publicly available data and building and styling a basic bar chart. You can communicate a lot with a simple chart, and hopefully these steps will be easy enough to get you started.
1. Downloading data
To begin, I found a data source on Kaggle. Kaggle is a community of data scientists and machine learning researchers. The site offers machine learning competitions, a cloud-based workbench for sharing code kernels, an AI education platform, and a platform for sharing public datasets. The public datasets are free to download, but you do need to create a Kaggle account.
The set I found (in the “Trending Datasets” section) is about video game sales from 1980 – 2018. It includes information about genre, publisher, date, and global and regional sales.
The file downloads as a zip archive containing a CSV (comma-separated values) file. CSVs are plain text files that are readable in a tabular format (the information is read as rows and columns). I’ve unzipped the document on my desktop.
2. Opening in Tableau
Next, I launch my Desktop edition of Tableau Public. (Don’t have it yet? You can download here.) It automatically launches a new Book. On the left, I see my options to connect to my data. From here, I choose “Text file”. I navigate to the file on my desktop, called “vgsales.csv”. I select and open, and the data table populates in my Tableau book.
This gives me a good look at what is there—you can scroll through to see the names, platforms, genres, etc. (Anyone remember Tekken? Pitfall?? MOHA?!) Don’t get distracted. If you must, go here to get it out of your system: https://www.free80sarcade.com/
3. Starting a Tableau Worksheet
Ok, now I’m ready to create a visual! The “Sheet 1” tab is highlighted in orange at the bottom. Click on it to start a new sheet within your book.
You’ll see the data from your dataset populate in the left column of the screen, under the “Data” tab. You’ll notice that there are icons to the left of the column names, and that above the gray line they are blue, and below they are green. This is Tableau sorting the data for you by type.
Above the gray line are “dimensions”. These are considered qualitative, or describing qualities or characteristics: genre, publisher, name, etc. These could also be considered discrete pieces of data, or data that is countable (vs. measurable—as in, “we sold 20 tickets to the show today.” Those tickets are individual and discrete—you wouldn’t sell ½ a ticket to someone.)
Examples of discrete data:
Baseball teams
Tickets sold
Cars driven
Below the gray line are “measures”, or quantitative data. These are quantities of something (like currency) and could be considered continuous, or occurring in a range over time. You’ll see the sales data listed here. The amount of $ would be considered continuous over time, because it’s measurable at any point along a timeline, and also divisible (you could spend $1.04342342 on something, technically.)
Examples of continuous data:
Height
Cost
Age
4. Building a Bar Chart
Let’s start building our bar chart. A bar chart is best for comparing discrete data. In this case, we’ll compare the sales of video game genres.
Start by dragging “genre” from the data column on the left to your “Columns” shelf. You’ll see the genre names pop in as column headers in the middle panel of the sheet.
Next, grab the “Global Sales” data from the side column and drop it onto your row. Boom! A bar chart.
Well, that was easy. Have fun! Bye!
Just kidding...let’s improve our chart.
5. What’s Our Story?
First question—what do we want to talk about with this chart?
If we’re curious about genre performance, we can focus on some aspect of that. Let’s say we want to look at our top three performers. How do we emphasize that story?
Sort for Clarity
We can start by organizing more deliberately. Right now, the genres are organized alphabetically. To make the ranking more clear, we can use the sort buttons at the top to sort ascending and descending. Now it’s obvious that Shooter, Sports and Action are clear favorites, and that strategy is perhaps a niche interest.
Consider the Title
What else can we do? It helps to editorialize the title. Double-click on the current title (“Sheet 1”), and you’ll get a window where you can write something more germane to your topic.
Consider the Color
We can also tweak how we’re using color. Let’s take our genre data and bring it over again—this time on the Color card. Oooh….look at all the pretty colors....
But how, might you ask, does this help tell the story of our top three genres? It doesn’t. Let’s change them.
Click on the downward arrow in the legend at the right. Select “Edit Colors” from the menu.
Tableau automatically selects a palette for you, but you can change it by clicking on the dropdown. For this exercise, select the “Color Blind” palette.
Using your arrow tool, draw a box around all the data items on the left, and then select “Very Light Gray” from the palette. Click outside of the data item list to deselect. Now we’ll just select the top three. Hold down your “command” key, and click on Shooter, Sports and Action. Then select Orange from the palette and click ok.
Voila! Now you can’t miss the top genres.
6. Tweak the Details
Remove Elements That Aren’t Helping
Now that we’ve done this, the legend doesn’t seem very useful anymore. Let’s hide it. Click on the downward arrow and select “Hide Card”.
Add Elements That Can Emphasize
Average Line
Another piece of information that might tell our genre performance story better is comparing our three top sellers against the average for global sales. We can do this by placing an Average Line. Go to your left column, and switch from “Data” to the “Analytics” tab. Under “Summarize”, you will see an option for “Average Line”. Click and drag it to your bar chart. Tableau gives you an option to add to “Table”, “Pane”, or “Cell”. Add the Average Line onto “Table”, and it will drop an average line into your bar chart. Now we can see that 6 of our 12 genres are performing above the average.
Double-check for Unnecessary or Unclear Elements
There are some additional tweaks you could do to make the chart more simple and to the point. The X axis title seems unnecessary, as most people are probably familiar with gaming genres. To get rid of it, you can right click “Genre” and select “Hide Field Labels for Columns”.
Next, we may want to be more descriptive with our Y axis label. To update this, double click on “Global Sales” and under “Axis Titles”, add text to it that reads “Global Sales in $ millions”.
That is one way to format a no-frills but easy to read bar chart that focuses on a specific story.
Save it to Tableau Public by clicking on the floppy disk icon (Wow, a floppy disk—how is it that still is a thing in icons? Does that confuse the youth of today?)
Thanks for following along! The next installment will be a basic line chart! Stay tuned…