Tableau Tutorial – Understanding the Basics

8 min read

Get 10-day Free Algo Trading Course

Last Updated on September 4, 2022

tableau tutorial

Table of contents:

  1. What is Tableau?
  2. What is Tableau Public?
  3. Is Tableau free?
  4. How is Tableau used in Finance?
  5. Why should I use Tableau?
  6. Why shouldn’t I use Tableau?
  7. What are Tableau alternatives?
  8. How to get started with Tableau?
  9. What are Tableau Sheets?
  10. What charts does Tableau have?
  11. What is the Tableau dashboard?
  12. How to create an OHLC chart in Tableau?
  13. What data sources does Tableau use?
  14. What data types does Tableau use?
  15. How can I ask my data in Tableau?
  16. Does Tableau have an API?
  17. Where can I learn more about Tableau?

What is Tableau?

Tableau is a visualization tool that allows its users to create complex charts of data without any programming experience.

It is often used in many data analytics roles (i.e. data analyst, data scientist).

What is Tableau Public?

Tableau Public is a free platform where you can explore, create, interact and share visualizations that are created in Tableau. It often comes in handy when looking for inspiration and new ways to approach data.

Is Tableau Free?

Yes and no. Tableau comes equipped with both premium and free versions. The premium version is known as Tableau Desktop and the free version is called Tableau Public.

Let’s explore the main difference between the two. When you hear that people use Tableau for building dashboards and making business data-driven decisions they are often referring to the premium version.

The premium version comes with more data connections, with the ability to save your data locally and upload it to a Tableau Server or Tableau Online (cloud version of Tableau). Tableau Desktop costs $70 a month.

On the other hand, with the free version, you must save your work files and data online. You also have limited data connections and no ability to access the Tableau Server.

But which one should you choose? The answer to this question depends on the type of work you do. The free version isn’t bad at all and is a great learning and starting point.

But if you’re working with sensitive data and would like to step up your Tableau game and have access to the cloud, then the premium version of Tableau is right up your alley. For this tutorial, we will use the free version.

How is Tableau used in Finance?

Tableau has a tremendous impact in the world of Finance as it allows the making of precise, optimal, and efficient reports. It also allows a quick way to analyze data and share the reports with stakeholders in a secure way.

Why should I use Tableau?

There are many benefits of using Tableau and here are the main ones:

  • Easy to use
  • Offers aesthetic and complex visualizations
  • Has high performance
  • Can handle big data
  • Reads a wide range of data sources
  • Friendly for mobile users
  • Has a great community

Why shouldn’t I use Tableau?

The things upon which Tableau could improve upon are the following:

  • Can get expensive
  • Lacks some sophisticated statistical tools
  • Can run into embedment issues
  • Poor customer support
  • Has poor versioning

What are Tableau alternatives?

Tableau is not the only BI software out there and depending on your preferences you might want to check these alternatives:

  • Power BI
  • SAS
  • Domo
  • Looker
  • InsightSquared
  • TIBCO Spotfire
  • Qlik Sense
  • Google Data Studio and more.

How to get started with Tableau?

In order to start exploring our data and building those pretty visualizations, we will need to download the Tableau Public software. In order to do this visit the following link, enter your email and click “DOWNLOAD THE APP”.

https://public.tableau.com/en-us/s/download

After you go through the installation steps a Tableau icon will appear on your desktop and/or in the path where you saved the installation. Let’s open it up and start exploring Tableau!

The first things that we can see on the left side are our available connections like Excel, JSON, Statistical, and other files. On the right side, we can see some in-built tutorial features, viz of the day, and resources.

Have in mind that we’re only going to explore the minimum basics of Tableau. At the end of the article, I’ll add useful resources where you can learn much more about Tableau and become a professional user.

Before we obtain some data related to finance, let’s ease in with a sample data set that can be accessed by clicking the “Sample Data Sets’ string on the right side. I’ll choose the Netflix Movies and TV Shows dataset.

When you download the dataset pick the Microsoft Excel connection on the left side and navigate to the obtained dataset. You should see something like this:

In order to explore the tables of the dataset click on one on the left side and drag it to the upper middle half of the screen. I’ll pick the first one (netflix_titles).

Here you can play with the data by changing its order, adding filters, adding multiple tables and connecting them and etc. Let’s move on to the Sheets where the real action takes place (don’t quote me on that one).

What are Tableau Sheets?

A Tableau sheet is a place where you visualize your data by dragging fields (variables/features/columns) onto the shelves. A sheet can be accessed by clicking the “Sheet 1” button on your lower Tableau tooltip ribbon.

Now that we are here we need to have in mind that Tableau requires you to add your data first by clicking on variables and dragging them over to the “Columns” or “Rows” shelf.

Let us start by adding some data that we want to explore. I will plug in the movie Titles to the rows and their Type to the columns.

If you move the Types to the Filters panel you will be able to filter the data by it. On the right side of the screen, checkboxes will appear for each category of the movie types that allows you to include or exclude them.

What charts does Tableau have?

Tableau comes equipped with many chart types that will suit your needs. The main chart categories would be area, boxplot, scatter, map, bar, line, and other charts.

Let’s go back to the Data Source (lower toolbar) and add two new sources which are the directors and countries. Then we will go back to our sheet and click on the world map chart that will appear on the right side.

In order to visualize the world map add the Country feature to the columns and then click on the map.

And you will get an ugly chart that shows a world map for each of the titles. In order to combat this on the left side, you will see green features of longitude and latitude. Let’s just leave them on the shelves:

You might notice that some variables are colored green and some blue. The logic behind this is that the green color represents continuous values while the blue ones represent discrete values.

Now let’s scratch all that by dragging the measures of the shelves and adding ratings and the total count of our titles. A packed bubble chart will become available, let’s see it.

Another way to clean your sheet is to use the following shortcut Alt + Shift + Backspace. Be sure to play around a bit with all the variable combinations and try to create other informative charts.

What is the Tableau dashboard?

A Tableau dashboard is a collection of visualizations that were created in the Tableau Sheets. To create a dashboard all that you need to do is to drag your sheets onto the dashboard.

On the left side, you can see all the modifications that you can make to your existing dashboard. You can add different objects like web pages, sliders, images, extensions, and more.

If you right-click on your sheet graph you can filter, annotate, duplicate, toggle its features, and more. Be sure to play around and see what you can come up with.

I’ll play with another dataset of S&P 500 stock data that was obtained with the Yahoo Finance API, create some quick random sheets, extend our dashboard and add a web page object to it.

This is a perfect opportunity to practice what you’ve learned. I’ll share the code that will obtain the data and you can then import it into Tableau, create some sheets and add some objects to the dashboard.

Then come back and compare your sheet to mine.

#pip install yahoo_fin
import pandas as pd
import yahoo_fin.stock_info as si

sp500_list = si.tickers_sp500()
sp500_historical = {}

for ticker in sp500_list:
    sp500_historical[ticker] = si.get_data(ticker, start_date="01/01/2019", index_as_date = False, interval="1d")
sp500_historical

data = pd.concat(sp500_historical)
data.reset_index(drop=True, inplace=True)
data.to_csv('S&P_500_data')

Let’s check it out:

How to create an OHLC chart in Tableau?

Creating an OHLC chart in Tableau requires several things. Firstly, we need to have the data for the specified timeframe, then we need to transform the features and tweak some parameters like the sizing, color, and charting.

Let’s go over the chart creation in a step-by-step way as you’ll learn some advanced features of Tableau. Firstly, we’ll obtain monthly data for the BTC-USD ticker via the Kraken API.

import pandas as pd
import krakenex
from pykrakenapi import KrakenAPI
api = krakenex.API()
k = KrakenAPI(api)

# Get data starting from 1st April 2021
ohlc = k.get_ohlc_data('BTCUSD', interval=1440, since=1617228000, ascending=True)

# Delete unix time column as our index column is set to y/m/d format
ohlc = ohlc[0].drop(['time'], axis=1)

# Download the data
ohlc.to_csv('BTC-USD')

Now locate the data and connect to it via Tableau. It should look something like this:

The next step is to go over to “Sheet 1” where we will do all of our work. Firstly, we will calculate the open/close and high/low spreads by creating new variables.

In order to do this, on the left side of the screen where all variables are listed right-click and press “Create Calculated Field”. A new pop-up will appear where we will calculate the spread.

Now, rename the field to “Spread_Open/Close” and insert the following calculation: sum([Close]) - sum([Open])

Click ok and do the same for the High/Low spread by dividing the low sum by the high sum like this: sum([Low]) - sum([High])

Now that we have our variables ready, let us add the time to the Columns shelf and change it to Daily values and Continuous.

Now we add the High and Open variables to the Rows shelf. As you can see, Tableau assumes that this is a line chart. We will change it in the Marks section to a Gnatt Bar type.

Now click on the Open variable and select Dual Axis.

To synchronize the data right-click on the y label of the Open variable and click “Synchronize Axis”. Then right-click again and toggle off the header.

Now we need to create our candlestick with the measures we calculated at the very beginning. On the left side of your screen, you will see the “Marks” section and your added variables.

Click on each spread and drag it to the Size Mark for the complementing variable i.e. High/Low spread onto the Size mark of High. Be sure to click on the Measure Names mark on the High variable and remove it.

Now click on the Size mark of the High variable and drag the slider to the utmost left. The next step is to click on the Open/Close spread and add it right onto the color mark of the Open variable.

Then click on the color and change it to the usual red and green combination. Be sure to change the step size to two. If you did everything properly you should have a chart similar to this one:

Now right click on the chart and go to format as we want to make it prettier. There you can edit your chart by removing the gridlines and tweaking some of the features. Be sure to play with them.

Let’s add a trend line. Right-click on the chart -> Trend Lines -> Show Trend Lines -> SUM(Open). A new trendline will appear, click on it and then go to edit and play with its features. Check out the format too!

Hint: make it thinner, change the color and convert it into a third-degree polynomial.

Now that you know the basics of Tableau, homework would be to create a daily price chart, daily volume chart, and a daily spread chart. Then make a Tableau dashboard out of them.

That’s it! I hope your dashboard looks prettier than my quick and dirty one.

What data sources does Tableau use?

As Tableau is a data analytics tool where data is the central thing it operates on, it comes equipped with the ability to read a plethora of data sources that extend with the premium package.

The most notable data sources would be:

  • Excel
  • JSON
  • Statistical File
  • PDF
  • Text File
  • Spatial File
  • Microsoft Access and more

What data types does Tableau use?

Tableau mainly uses seven data types and they are the following:

  • Numerical Values
  • String Values
  • Date Values
  • Date & Time Values
  • Geographic values
  • Cluster Values
  • Mixed Values

How can I ask my data in Tableau?

Tableau Online and Tableau Server come equipped with the possibility to ask your data a question upon which the program will automatically create a chart that should answer it. Go here to read more about it.

Does Tableau have an API?

Yes! And the REST API lets you manage Tableau Server, Tableau Online site, and Prep Conductor resources using HTTP. You also gain access to the functionality of data sources, projects, workbooks, sites, and more.

For more information about the Tableau REST API visit the following link.

Where can I learn more about Tableau?

If you wish to learn more about Tableau there are several paths that you can go down and I’ll list a few of them:

Igor Radovanovic