Tableau Tutorial for Beginners
By: Natassha Selvaraj
Tags: Tableau, Data Analysis, Data Visualization, Data Science, Business Analysis

Before we conduct the data analysis, it is important to understand the types of variables we have in the data set.

When using Tableau, you will need to know the difference between numeric variables (a measure), and categorical variables. You will also need to know the difference between discrete and continuous variables, and how to visualize them.

Let me break this down for you.

Numeric Variables:

As the name suggests, numeric variables are variables that can be measured. They are also known as quantitative variables and are in the form of a numeric value.

A numeric variable can be of two types — discrete and continuous.

Discrete Variables:

The value of a discrete variable is obtained from counting.

For example, The number of candies in a jar is a discrete variable.

Continuous Variables:

The value of a continuous variable is obtained by measuring. Any measurable quantity such as time, distance, and the temperature is a continuous variable.

For example, The height of students in a class.

Categorical Variables:

A categorical variable represents the type of data that can be divided into groups.

For example, Race, sex, age group

Now that you understand the difference between the types of variables, we can move to the next step.

Step 2: Download and Install Tableau

Click on this link to download and install Tableau Public on your computer. Tableau Public is a free service that allows anyone to create interactive visualizations.

It is a free version of the Tableau Software that allows you to use most of the software functions. You can connect to CSV files, Excel spreadsheets, and text documents.

However, you will not be able to save your work locally on your computer. You will have to save and access it from Tableau Public.

Step 3: Connect Data Source

After your installation is complete, open Tableau Public. You will see a pane that looks like this on the left side of the window.

To connect to our data, click on Microsoft Excel. Then, find the Excel spreadsheet we just created and open it.

You will see a window that looks like this:

The data has been successfully loaded into Tableau.

Step 4: Data Analysis

To start analyzing the data, click on Sheet 1 at the bottom left corner of the screen.

You will see the following screen come up:

Pay careful attention to the data pane (on the left side of the screen). You will see the different variable names.

There are two things you need to know about the way Tableau classifies variables:

Data Type

Firstly, Tableau assigns each variable a data type — String, DateTime, Decimal, etc.

It is important to take a look at each variable and ensure that the data type is correct since it is possible for Tableau to get it wrong ( For example, Tableau could incorrectly classify a Datetime object as a String).

In this case, however, Tableau has seemed to have assigned the correct data type to each variable. We do not need to make any changes here.

Measures and Dimensions

Tableau also classifies variables into measures and dimensions.

Measures are types of variables that can be aggregated, or used for mathematical operations.

Dimensions are fields that cannot be aggregated.

You can think of measures as continuous variables, and dimensions as discrete variables (refer to the first step of the tutorial if you don’t remember the difference).

Let’s take a look at the data pane again:

The variables at the top half of the pane, such as ‘Cabin’ and ‘Embarked’ are classified as dimensions.

Variables in the bottom half, such as ‘Age’ and ‘Fare’ are classified as measures.

It is possible for Tableau to incorrectly assign a variable as a dimension or a measure. In this case, there are two instances where Tableau has done so. We will need to re-define these variables.

We will take a look at the data set again to identify the incorrectly defined variables.

The variables Pclass and Survived were classified as measures or continuous variables.

However, these variables are discrete. Although they are numerical, they represent a category and not some sort of quantity.

For example, take a look at the variable ‘Survived.’ A value of 1 indicates that a person survived the Titanic, and a value of 0 indicates they didn’t. This is a categorical variable.

We need to change these incorrectly defined variables before we start visualizing the data.

To do this, you just have to drag and drop. Click on the incorrectly defined variable and drag it up to the dimension section of the pane.

Here’s what it should look like when you’re done:

There are only four variables in the measure section, and everything else is classified as a dimension.

Now, we can start with the visualization process.

Step 5: Data Visualization

Histograms

We will start by visualizing one variable. When visualizing the spread of one numeric variable in a data set, a histogram is used.

First, we will visualize the distribution of the variable ‘Age.’

In order to do so, we will first need to create bins or intervals of the age group:

Choose a bin size of 10, and click ‘OK.’

The variable ‘Age (bin)’ should appear on your data pane:

To visualize the age group we just created, drag the ‘Age (bin)’ variable to the Columns pane at the top of the screen. Then, drag the ‘train(Count)’ variable to the Rows pane:

After you do this, you will see a histogram like the one below:

Age Distribution of Titanic Passengers

This is a good, clear visualization of the age distribution in our data set. However, it can be improved.

If you look closely, you will notice the value ‘Null’ on the X-axis.

To remove the null values:

Click on the drop-down near ‘Age (bin)’, and click on ‘Show Filter.’

The following should appear on the right-hand side of your screen:

Untick the checkmark next to ‘Null,’ and you will no longer see null values in your histogram:

Age Distribution of Titanic Passengers

If you want to change the colors of the bins, drag the ‘Age (bins)’ variable to the Color button in the Marks card:

Then, click on Color -> Edit Colors to choose a color palette:

Select a color you like, click on Assign Palette, and click ‘OK.’ You will now have a histogram with the colors you chose:

2. Similarly, we can now visualize the variable ‘Fare.’

Repeat the entire process to create a histogram for passenger fares. This time, use a bin size of 30.

Your chart should look similar to this:

Count Plots

Similar to the histograms we created for the variables ‘Age’, and ‘Fare’, we can create count plots for categorical variables.

First, we will visualize the counts of the variable ‘Survived.’

Note: Remove the variable ‘Age (bin)’ from the Columns section and the marks card. You will have to do this each time you want to create a new visualization.

Just drag the variable ‘Survived’ to the Columns section and the variable ‘train(Count)’ to the Rows section.

Then, drag the variable ‘Survived’ to the Color button in the Marks card, and choose a color palette:

Here’s how the graph will look:

You can do the same to visualize the remaining categorical variables in the data set.

Pclass

Follow the same steps as before, and you should get a visualization that looks like this:

Bar Chart

Bar charts are great for visualizing the relationship between multiple variables.

Were female passengers more likely to survive the Titanic than male passengers?

To answer this question, I two variables — ‘Survived’ and ‘Sex’ need to be visualized in a count plot. Based on the type of insight you want to get, you can color this by either variable:

The resulting plot will be something like this:

Survived and Sex

By just looking at this graph, we can find a correlation — female passengers did seem more likely to survive the Titanic than male passengers.

Tableau’s Marks Card

Before moving on to the next visualization, you need to know about an important feature of Tableau — the marks card.

Marks Card

Click on the “Show Me” button on the top right corner of the page, and you can find the marks card. Here, you can see different types of charts.

Tableau allows you to play around with different types of graphs to visualize the same data — there are bubble charts, tree maps, box plots, etc.

You can take a look at some of these, and spend some time creating different charts.

However, be careful when using these to visualize your data. Some of these graphs may look pretty but aren’t necessarily the best visualization practices.

Using charts that are too sophisticated may make it difficult for others to read and interpret, so proceed with caution.

Stacked Chart

An alternative way to visualize the ‘Sex’ and ‘Survived’ variables above is to use a stacked chart.

Select the stacked chart option from the Marks Card

Click on the card that looks like a stacked bar chart.

You should see a graph that looks like this. The bars for the variable ‘Sex’ are no longer visualized side by side. Instead, they are stacked on top of each other.

Stacked Chart — Survived and Sex

More Visualizations

Applying what we have learned above, we can create visualizations to find answers to the following data questions:

Note: I suggest writing down the questions. Then, create your own visualization to try and answer them yourself.

Did the passenger class a person was in have any impact on whether they survived the Titanic?

It looks like passengers in the third class were far less likely to survive than passengers of any other class.

Did the port the passenger embarked from have any impact on their survival?

There appears to be no apparent relationship between the variables ‘Embarked’ and ‘Survived.’

Were younger passengers more likely to survive the Titanic?

Note: To answer this question, you can use the variable ‘Age’ or ‘Age (Bin).’

Age and Survived

Age and Survived

The age distribution of passengers who survived the Titanic is similar to the age distribution of passengers who didn’t. There seems to be little to no correlation between age and survival.

Were passengers who paid higher fare prices more likely to survive the Titanic?

Note: I changed the bin size to 25 to get a clearer picture.

It can be observed that passengers who paid higher fare prices ($50 and above) have higher survival rates than passengers who bought cheaper tickets.

Visualizing Multiple Variables

Tableau is a great tool to use when you need to visualize the relationship between more than two variables at once because there are just so many ways to do it.

To show you an example, I will visualize the relationship between the variables ‘Age’, ‘Sex’, and ‘Survived.’

Survived and Age group with Sex

There are many different ways you can do this, depending on the variable you want to stand out.

You can re-position the graph and try coloring different variables, and see what answers your data question best.

Sometimes, visualizing the same variables in many different ways can give you an entirely new perspective.

I will now visualize a few more variables to find the relationship between them, and you should try these on your own.

‘Fare’, ‘Sex’, and ‘Survived’

‘Fare’, ‘Pclass’, ‘Survived’

‘Age’, ‘Pclass’, ‘Survived’

6. Marks, Tooltips, and Annotations

Using marks, tooltips, and annotations can make it easier for people to read your graph.

However, you should use these wisely to avoid cluttering your graph with too much information.

Tooltips

Tooltips are the details that appear when you hover your pointer over the visualization:

Survived Count — Tooltip

You can choose to add information to your tooltip, without adding it to the visualization.

Re-create the survival count chart above. Then, all you need to do is drag the variable you want to add to the Tooltip button in the Marks card:

This way, every time someone hovers a pointer over your graph, they will be able to see this additional information:

Survival Count with Tooltip

As you can see in the chart above, the tooltip has information on the passenger’s sex, which is not displayed in the graph.

Note: I would not recommend using tooltips this way. When visualizing categorical variables, it is always better to use a different hue or a separate column. I only created this to show you how you can use tooltips in the future.

Annotations

It is possible to display the information you see on the tooltip as an annotation on your graph.

This way, you can call out a specific mark or point on your graph and get readers to see it easily.

This is especially useful when visualizing location data in a map because you get to annotate and draw attention to a particular area.

Here’s how to annotate your graph:

Right-click on the histogram and click on Annotate -> Mark

2. A screen like this will appear. You can choose to remove marks you don’t want, and click ‘OK.’

You will now see the annotation appear like this:

And… We’re done!

I hope this tutorial helped you get started with basic data analysis and visualization with Tableau.

Of course, there is so much more to data visualization in Tableau, and we have barely scratched the surface.

If you are interested in learning more about exploring, analyzing, and visualizing data, I would suggest the following free learning resources:

Photo by Thought Catalog on Unsplash

Data Visualization and Communication with Tableau — Duke University

This is a complete beginner’s course, that takes you through the basics of business analytics and data exploration. It is a 5-course specialization, that teaches you how to apply statistical analysis to make business decisions.

It takes you through using SQL to query your data, statistical techniques, business analysis, Tableau, and data communication/storytelling.

This course is free to audit, though you will need to pay if you want a certificate.

2. Tableau for Data Science and Visualization — Crash Course (freecodecamp)

This is a crash course to help you get started with Tableau and is a 29-minute video.

If you want to dive in and start using Tableau right away, this is a course you should take.

I would suggest this course if you learn better from watching video tutorials than reading articles.

3. Foundations of Data Analysis — edX

This course does not teach you Tableau. I have added it to the list because I think it is a great resource to understand statistical thinking and data analysis.

It teaches you the concept behind data exploration, and how to ask the right data questions. It also goes slightly deeper into the mathematical and statistical concepts required to learn data science.

The visualizations in this class are implemented in R programming. However, no prior programming experience is required, they’ll show you how to do it from scratch.

Technique > Tool

Photo by Haupes Co. on Unsplash

Personally, I feel like learning the technique, or the method behind something is far more important than learning the tools to implement it.

If you learn the technique to perform data analysis and visualization, you can easily pick up different tools to do the job.

Once you learn the science behind statistical analysis and data visualization, you can quickly figure out how to implement it using different tools — R/Python libraries, Excel, Tableau, PowerBi, etc.

Always prioritize learning the technique over learning the tools.

That’s all for this article! Thanks for reading :)