You are on page 1of 333

Copyright

Copyright © 2020 by N. Selvam CA(M), ACMA, CGMA

Published by:
N Selvam
1108, Lobby 2,
11th Floor, Block A, Damansara Intan,
No. 1, Jalan SS20/27, 47400 Petaling Jaya,
Selangor Darul Ehsan,
Malaysia

December 2020
All rights reserved. Reproduction or use, without express permission of editorial or pictorial contents,
in any manner is prohibited. No patent liability is assumed with respect to the use of the information
contained herein. While every precaution has been taken in the preparation of this manual, the publisher
assumes no responsibility for errors or omissions. Neither is any liability assumed for damages
resulting from the use of the information contained herein.

ISBN Number: 978-967-18073-1-6

Tableau Public and Desktop - Is a registered trademark of Tableau Software, LLC.


Microsoft Excel - Is a registered trademark of Microsoft Corporation
Preface to the Second Edition
I wish to express my sincere gratitude to all who purchased my 1st Edition of
Data Visualization with Tableau for Beginners. Thank you. You have given
me the strength and inspiration to release the 2nd Edition.
When preparing this 2nd edition, my primary focus was to make it easier for
anyone who was new to Tableau to complete all the exercises in my book.
Many slips and shortcomings in the previous edition have been set right.
I made significant changes to this Edition as many students and the working
public made constant references to my book when learning how to use
Tableau. The Chapters have been re-organized and increased from 8 to 14. I
also included 2 Chapters on topics that would appeal to many. Charting
Lottery Results and Stock Market.
The learning must never stop.
I am glad I was able to help many of my readers to broaden their knowledge
and acquire skills sets on data visualization through my book.
My greatest satisfaction is when I get a mail telling me how much my book
has helped them in their career path.
N Selvam
Dedication
This book is dedicated to my late mother, D.Mageswary. She passed away
on 22 Nov 2020 and my 2 children: Eily Lee Selvam and Nelly Lee Selvam.
Acknowledgments
My first Edition was released in June 2020 and I wanted the 2nd Edition to be
ready in December 2020.

Getting the 2nd Edition out was a real challenge. I did many hands-on training
sessions on Tableau and gathered extensive feedback on what topics my
readers would like to see in my next book. Many of them suggested I should
include a Topic on Lottery and one more Topic on Share Market and I am
glad I managed to do this in my 2nd Edition.

My wife Eluza and my two children were always there to give me all the
support I needed and I will always be grateful. Writing took up a lot of my
personal time.

I would like to place on record my sincere thanks to Aaron K Abraham. He


went that extra mile to help me with the promotion for my 1st Edition. I called
him my social media guru. I would also to thank my Team Members from N
Selvam Consult (S.Magesvary who helped to liaise with the printers and
Kenneth Goh who did the proofreading and assisted extensively with the
contents and pictures). Big help to ensure the book was released on time.
Table of Contents
Chapter 1 – Introduction
What is Tableau?
Why do we use Tableau for data visualization?
6 steps in the data visualization process
What is happening in today’s world?
Tableau Products
Investment for Tableau Desktop
For students
Reference Sites for Tableau
What did you learn from this Chapter?
Chapter 2 – Downloading Tableau Public, Installation and Creating a Profile
Tableau Public
Download Tableau sample data for the exercises from Chapter 7 to 11
in this book
What did you learn from this Chapter?
Chapter 3 – The Startup Screen for Tableau Public
The Startup Screen for Tableau Public
Menu
File Menu
Data Menu
Help Menu
Connect
Discover
What did you learn from this Chapter?
Chapter 4 – The Data Source Page
Tableau Sample Data
Menu
File Menu
Data Menu
Windows Menu
Help Menu
Tool Bar
Connections
Sheets
Use Data Interpreter
Excel Worksheets
New Union
Canvas
Preview Data Source
Manage Metadata
What did you learn from this Chapter?
Chapter 5 – Tableau Workspace
Workspace area
Pills
Shelves
Menu Bar
File Menu
Data Menu
Worksheet Menu
Dashboard Menu
Story Menu
Analysis Menu
Map Menu
Format Menu
Window Menu
Help Menu
Tableau Toolbar
Show and Hide the Side Bar (Data Pane)
The Data Pane
Perform Common Tasks in the Data Pane
Marks
Show Me
What did you learn from this Chapter?
Chapter 6 – Exploring the Tableau Workspace
Exercise 01 – Double click on Category and then double click on Sales
Exercise 02 – Double click on Sales and then double click on Category
Exercise 03 – Drag Category to Columns and then drag Sales to Rows
Exercise 04 – Drag Category to Rows and then drag Sales to Columns
Exercise 05 – Drag Category and Sales to Rows
Exercise 06 – Drag Category and Sales to Columns
Exercise 07 – Drag Category and Sales to the View
Exercise 08 – Select Category, Sub-Category, Sales and then click on
Show Me
Exercise 09 – Select Category, Country, Sub-Category, Sales and then
click on Show Me
Exercise 10 – Double click on Measure Names
Exercise 11 – Double Click on Measure Values
Exercise 12 – Double click on Rows or Columns and type in the Field
Name
Exercise 13 – Double click on Category and then Segment. Next double
click on Sales
Exercise 14 – Drag Category and Sub-Category to Rows. Drag Sales to
Columns. Drag Sales to Colour, Size and Label in Marks. Drag
Discount, Profit, Quantity and Shipping Cost to Details in Marks. Click
on Tool Tip and change Discount: to Rebate:. Lastly, click on Colour,
Edit Colours
Exercise 15 – Drag Category and Sub-Category to Columns. Drag Sales
to Rows. Drag Sales to Label and Colours in Marks. Lastly, click on
Colour, Edit Colours
What did you learn from this Chapter?
Chapter 7 – 4 Pivot Tables, 3 Pivot Charts and 1 Dashboard built using
Microsoft Excel
Exercise 01 – Sales and Sales % by Country (sorted in descending
order)
Exercise 02 – Sales by Ship Mode by Country (rounded to the nearest
dollar and sorted by First Class)
Exercise 03 – Sales by Country by Year (rounded to nearest thousand
and sorted by Grand Total)
Exercise 04 – Sales by Category by Sub-Category (in thousands and
sorted by sales value in descending order)
Exercise 05 – Donut Chart. Sales by Ship Mode (First Class, Same
Day, Second Class and Standard Class)
Exercise 06 – Lollipop Chart. Sales by Ship Mode (Standard Class,
Second Class, Same Day and First Class)
Exercise 07 – Sparklines. Sales by Sub-Category by Market (2013 to
2015 excluding Canada and EMEA)
Exercise 08 – Dashboard. Slice by Ship Mode
What did you learn from this Chapter?
Chapter 8 – Building similar Tables and Charts in Chapter 7 using Tableau
Public
Exercise 01 – To verify the number of records read by Tableau
Exercise 02 – Sales and Sales % by Country in descending order
Exercise 03 – Sales by Ship Mode by Country. Sorted by First Class
Exercise 04 – Sales by Country by Year. Sorted by Grand Total
(nearest thousand)
Exercise 05 – Sales by Category by Sub-Category (from 2011 to 2013)
sorted by Total Sales (in thousands)
Exercise 06 – Donut Chart. Sales by Ship Mode (First Class, Same
Day, Second Class and Standard Class)
Exercise 07 – Lollipop Chart. Sales by Ship Mode (First Class, Same
Day, Second Class and Standard Class)
Exercise 08 – Sparklines. Sales Q1 to Q4 for 2013 to 2015 by Sub-
Category by Market (excluding Canada and EMEA)
Exercise 09 – Tableau Public Server
What did you learn from this Chapter?
Chapter 9 – Build 7 popular charts to acquire additional skills sets
Exercise 01 – Bar Chart to show Sales by Categories by Sub Categories
(in descending order)
Exercise 02 – Treemaps to show Sales by Sales Person (Sales Value
and % Sales)
Exercise 03 – Map to show sales by Geographical Areas
Exercise 04 – Step Chart to chart daily Sales for December 2014
Exercise 05 – Bubble Chart to show sales by Category by Segment and
Sales % within each Segment
Exercise 06 – Waterfall Chart to show profit % by Sub-Category over
Total Profit
Exercise 07 – Bar and Line Chart to show Sales and Profit by Months
for 2014
What did you learn from this Chapter?
Chapter 10 – Putting the Viz/ Charts together to build a Dashboard and share
with others
What is a Dashboard in Tableau?
Best Practices for Effective Dashboards
Building the Dashboard
What did you learn from this Chapter?
Chapter 11 – Introduction to Sets, Filters, Parameters and LOD
What are Sets in Tableau?
What are Filters in Tableau?
What are Parameters in Tableau?
What are LOD in Tableau?
Exercise 01 – How to build Sets to get Top “N” records. E.g. Top 5
Sales by Sub-Category
Exercise 02 – How to build Parameters and combine with Filters. E.g.
to view Profit or Sales by Category/ Country/ Person
Exercise 03 – How to build a Fixed LOD to show Total Sales by
Category, Sales by Sub-Category and % Sales by Sub-Category
Exercise 04 – How to build a Fixed LOD to chart the number of
Customer Orders by Region?
What did you learn from this Chapter?
Chapter 12 – Tableau with a Microsoft SQL Accounting System
Tableau Desktop
Tableau Public
Exercise 01 – Chart Source Currency outstanding balances in Accounts
Receivable (AR) and Accounts Payable (AP)
Exercise 02 – Chart Sales by Salesman by Quarters for 2019 by
functional currency
Exercise 03 – Build the Dashboard
Exercise 04 – Other Areas (applicable if you have installed Tableau
Desktop)
Exercise 05 – Dates in the Accounting System
What did you learn from this Chapter?
Chapter 13 – Plotting Malaysia 4D Lottery Results
Exercise 01 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by
Lottery/ Date/ Result/ Prize
Exercise 02 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by Date/
Lottery/ Result/ Prize
Exercise 03 – Plot the Top 3 Prizes SEP/OCT/NOV 2020 – by Prize/
Date/ Lottery/ Result
Exercise 04 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by Prize/
Lottery/ Date/ Result
Exercise 05 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by Prize/
Date/ Lottery/ Result
Exercise 06 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by Prize/
Lottery/ Result/ Date
Exercise 07 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by Result/
Prize/ Lottery with Filters for Lottery/ Prize/ Date
Exercise 08 – Plot the Top 3 Prizes SEP 2020
Exercise 09 – Plot the number of records for each series from 0 to 9 for
SEP/ OCT/ NOV 2020
Exercise 10 – Packed Bubbles to show the Results for Oct 2020
Exercise 11 – When the Results were last drawn and what Prizes it won
Exercise 12 – Number of times the Result was drawn over the last few
years
Exercise 13 – Build the Dashboard
Chapter 14 – Tableau and the Stock Market
Datasets
Exercise 01 – Build a Text Table to show Open/ Close/ High/ Low
Exercise 02 – Build a Line Chart to show Open/ Close/ High/ Low
Exercise 03 – Build a Candle Stick Chart
Exercise 04 – Build a Candle Stick Chart with Daily Volume
Exercise 05 – Build a Line and Bar Chart to show Closing Prices and
Volume
Exercise 06 – Build a Line to show Open and Close Prices
Exercise 07 – Build an Area Chart to show Closing Prices
Exercise 08 – Build a Line and Bar Chart combined to show Volume
and Open Close Prices
Exercise 09 – How to filter the Gains or Losses in Candle Stick over a
time frame/ period
Exercise 10 – How to replace the current Dataset with a new Dataset
(same number of columns)
Exercise 11 – How to refresh after adding new records to the same
Dataset
Exercise 12 – You have the option to Copy and Paste the Dataset
directly into the Worksheet
Glossary
Free Public Data Sets
Chapter 1
Introduction
Chapter 1 - Introduction
What is Tableau?
Tableau is a powerful and fast-growing data visualization tool used in the
Business Intelligence Industry. It helps in simplifying raw data into easily
understandable format.
Why do we use Tableau for data visualization?
Tableau is easy to learn and use. Tableau helps anyone quickly analyze,
visualize and share information. Data analysis is fast with Tableau and the
visualizations created are in the form of worksheets, dashboards and stories.
6 steps in the data visualization process
1. What do you want to analyse?
You must clearly define what you are trying to analyse. E.g. why was
there a drop in sales revenue over the last 12 months?
2. Gather the data relevant to this analysis.
After a purpose has been defined, commence collection of data that is
relevant to this analysis. This step is important because whichever
sources of data are chosen will determine how in-depth the analysis is.
3. Does the data require cleansing?
Before starting any analysis, one of the key issues to consider is
whether the data is in the right format. Can the data be used “as is” or
requires data cleansing? Data cleansing is extremely important during
the data analysis process because you could have received “bad data”.
4. Use the right tools for the visualization.
Data visualization is used primarily to present results. Tableau would
be an excellent tool to get this job done.
5. Interpret the results.
The next step is interpreting the results from the data visualization. This
step is important because it is how a business will gain actual value
from using the right software. The interpretation however, is relative. It
will depend on your domain knowledge, skills and experiences.
6. Take action.
What action is taken and how soon will depend on many factors e.g.
finances, urgency, policy and man power.
What is happening in today’s world?
There is huge amount of data available from so many different sources
because of technological advancement. People all over the world are
accessing the same data sets for multiple reasons and have different
interpretations. The important task is working towards getting the analysis
right and communicating the findings with the relevant parties. We know for
a fact that people tend to understand complex information when pictures and
stories are used. We are aware to communicate effectively, we must use a
combination of images and words that explains the underlying data and
analysis.
This is where Tableau comes in. It is truly amazing what the drag‐and‐drop
features in Tableau can do. It lets you explore the data in so many ways and
to share the results with anyone on your list.
Tableau Products
A cross-section of the Tableau Products.
1. Tableau Reader

https://www.tableau.com/products/reader
Tableau Reader is a free desktop application that allows you to open
and interact with Tableau workbook files that have been created in
Tableau Public and Desktop. However, it is not possible to make any
changes to the visualizations using Tableau Reader.
2. Tableau Public

https://public.tableau.com/en-us/s/download
Tableau Public is a free software that allows you to connect to a
spreadsheet or file and create interactive data visualizations for the web.
Tableau Public is a hosting service for the publication of data
visualizations to the web. It is used by newsrooms and bloggers,
companies, research institutes, governmental bodies and non‐
governmental organizations that aim to get their stories into the public
eye. Good starting point to build a career in data visualization.
Note:
Tableau Public has some limitations:
a. You have to save your visualization (Viz) in the Tableau Public
Server. You are given 10 GB storage limit.
b. Has limited file formats (Text , JSON , Excel, Microsoft Access,
PDF, Spatial, Statistical).
c. Has limited data connectors (Google Sheet, Web Data Connector).
d. Support for datasets up to 1 million rows.
e. It is not recommended for sensitive data as the public can view the
saved visuals.

This is the start-up screen when you launch Tableau Public.

If you click on More… > under To a Server, for Tableau Public, you
will be able to see the complete list of data connectors that can be used.
3. Tableau Desktop

https://www.tableau.com/products/desktop/download
Tableau Desktop is a data visualization tool that helps you to get
actionable insights about data fast. It differs from Tableau Server in that
it provides you with the ability to develop comprehensive, interactive
workbooks and dashboards to fulfill your academic or business
requirements.
Tableau Desktop is an application for Windows and Mac, used
primarily by analysts and business Users. In Tableau Desktop, you can
connect to flat files (such as Excel and CSV files) and save the
workbooks to the local hard drive. You can also use Tableau Desktop to
connect to a host of different database solutions and can share the
workbooks via Tableau Server or cloud‐based Tableau.
Note: If you downloaded and installed Tableau Desktop and the
product is not activated, Tableau will show the number of days the
product trial will expire. You are given 14 days trial period.
This is the start-up screen when you launch Tableau Desktop.

If you click on More… > under To a Server, you will be able to see the
complete list of data connectors that can be used.
When you save the visualization using Tableau Desktop, you can save
using the following file extensions.

.twbx
The .twbx file is a Tableau Packaged Workbook, meaning it is the
original .twb file grouped together with the data source(s) in one
package. .twbx files can be considered analogous to specialized zip
files, in which these “zip” files contain all the information necessary to
work in Tableau. The primary advantage to using .twbx files is that
analysis can be performed without network/ internet connections
because the data is already present in this packaged file.
.twb
The .twb file alone is not enough to perform any analysis because it
only contains Tableau’s instructions for interacting with a data source.
In actuality, .twb files are XML files specially tailored to interact with
data sources.
4. Tableau Prep Builder
https://www.tableau.com/products/prep/download
Tableau Prep Builder is a Tableau product designed to help everyone
quickly and confidently combine, shape and clean their data for
analysis. Tableau Prep is the latest addition to the Tableau product suite
and is designed to help you prepare the data before analysing it in
Tableau Desktop. The visual interface allows to quickly merge
differently formatted data sets, clean the data and unify the level of
aggregation. Tableau Prep fits seamlessly into the analysis workflow.
5. Tableau Online
Tableau Online is your analytics platform fully hosted in the cloud.
You can publish dashboards and share the discoveries with anyone.
Invite colleagues or customers to explore hidden opportunities with
interactive visualizations and accurate data. All easily accessible from a
browser or on the go with mobile apps.
Investment for Tableau Desktop

$70 (USD) per user per month/billed annually. (at the time of publication)
Tableau Creator is designed for individual analysts and power users. It
includes access to Tableau Desktop and Tableau Prep as well as one
Creator license to either Tableau Server or Tableau Online.
For students
Students at accredited academic institutions worldwide are eligible for a free
one-year license to activate Tableau Desktop and Tableau Prep. You must be
16 years of age or older to request a license.
Apply via https://www.tableau.com/academic/students#form
Reference Sites for Tableau
1.Tableau :https://www.tableau.com/
2.Getting started with :https://www.tableau.com/en-gb/learn/get-started
Tableau
3.Free Learning site from :https://www.tableau.com/learn/training
Tableau
4.New Features :https://www.tableau.com/products/new-features
5.Templates :https://www.tableautemplates.com/
6.Download Practice :https://www.superdatascience.com/pages/tableau
Datasets
What did you learn from this Chapter?
1. Introduction to Tableau.
2. The 6 Steps in the data visualization process.
3. Very useful reference sites for Tableau.
Chapter 2
Downloading Tableau Public,
Installation and Creating a Profile
Chapter 2 – Downloading Tableau Public, Installation and
Creating a Profile
Tableau Public
1. Tableau Public will be used for all the exercises in this book as the
book is targeted to students, the working adults who are new to Tableau
and to anyone who wants to learn more about data visualization.
2. The Software can be downloaded for free at
https://public.tableau.com/en-us/s/download

3. Install the free software to learn about Tableau. Build new skills and
knowledge. This could open new career opportunities.
4. You must enter an e-mail address before you can click on
DOWNLOAD THE APP.
Note:
If internet access is not available, get a copy of the latest installer. You
can install and run the application but will not be able to save your
visualizations.

After the installation is complete, Tableau Public should launch


automatically else click on the short-cut.

5. Next, select File Menu → click on Manage My Profile.


You must have internet access.
Anyone who want to share their data discoveries with the outside
world, must save their workbook to Tableau Public, a free cloud
service. On Tableau Public, you can interact with the saved views or
download the saved workbooks or data sources.

6. Click on “Create one now for free” and enter the required information
to Create a
Profile.

7. Once you have successfully created your Profile, you will be


automatically directed to Tableau Public Portal.
a. Select “your profile picture” → then click on Sign Out from the
Tableau Public Portal and exit but in your local machine, you may
still be signed into the Tableau Public Portal.

b. In your local machine, click on the Status Bar and Sign-Out.


8. I would recommend that you sign-in again and then sign-out one more
time Select File Menu → click on Manage My Profile → Sign In and
remember to sign out (from 2 places → Tableau Public Server and local
machine).

Download Tableau sample data for the exercises from Chapter


7 to 11 in this book
1. Download the Excel file/ dataset (Filename: Global Superstore.xls)
from:
http://www.tableau.com/sites/default/files/training/global_superstore.zip
2. Global Superstore contains information about products, sales, profits
and other relevant information that you can use to identify key areas for
improvement within this fictitious company.
3. Save this file in a Folder called <e.g. Tableau Hands-on Training>. The
author recommends that you also save all the exercises and additional
datasets in this book in the same folder.
4. Open the file in Excel. Confirm that there are 3 Worksheets and there
will be 51291 Rows in the Orders Worksheet Once confirmed, close the
Excel file.

What did you learn from this Chapter?


1. Software installation and creating a profile.
2. Where to download the sample data required for the exercises in this
book?
Chapter 3
The Startup Screen for Tableau
Public
Chapter 3 – The Startup Screen for Tableau Public
The Startup Screen for Tableau Public
The first thing you will see after you launch Tableau Public is the Start Page.

Menu

File Menu
Data Menu

Help Menu

Need Help → Press F1 anytime.


Help Menu → click on About Tableau Public → to check your version of
Tableau.
I am using version 2020.4.0 (at the time of publication).

Connect
You must select the connector (how to connect to the data that you want to
use).

The start page gives you several options to choose from:


1. Click the Tableau icon in the upper left-hand corner of any page
to toggle between the Start Page and the Workspace.

2. Under Connect, you can connect:


To a File
Connect to data that is stored in a file, such as Microsoft Excel, Text
File, JSON File, Microsoft Access, PDF, Spatial files and Statistical
File. To a Server
Connect to data that is stored on a Server, such as Google Sheets or
Web Data Connector.
Reminder: If you are using Tableau Public, you will have limited
data sources.
Discover
a. How to Videos:
1. Overview
2. Intro to the Interface

3. Chart Types

4. More how-to-videos

b. Viz of the Day:


1. A taste of Christmas
https://public.tableau.com/en-us/gallery/taste-christmas
2. Blog – Get insights faster with Explain Data
3. Sample Data Sets
4. Live Training

5. Current Status

What did you learn from this Chapter?


1. What you can find in the startup screen for Tableau Public?
Chapter 4
The Data Source Page
Chapter 4 – The Data Source Page
1. Launch Tableau Public.
2. File Menu → Open → select the following Excel File (Global
Superstore.xls). This is the Excel file that you downloaded in Chapter
2.
3. You can also click on To a File → Microsoft Excel to load the Excel
File.

After you connect to the Excel data, the Data Source page shows the
Excel sheets or tables in the data.
Tableau Sample Data
Global Superstore.xls
Menu

File Menu
Data Menu

Windows Menu

Help Menu
Tool Bar

Show Start Page

Undo Redo

Save to Tableau Public

Refresh Data Source


Connections
Global Superstore
Microsoft Excel. This is the dataset opened in Tableau.

Sheets

Use Data Interpreter


What does Data Interpreter do?
Data Interpreter can give you a head start when cleaning your data. It can
detect things like titles, notes, footers, empty cells, and so on and bypass
them to identify the actual fields and values in your data set.
Excel Worksheets

New Union
To combine two or more tables by appending values (rows) from one table to
another.

Canvas
Drag Orders to the Canvas to start exploring that data. (Note: This will
extract all records) You can also double click on the Order table.
Note: If your Excel File has only 1 Worksheet, it will appear automatically in
the Canvas.
Preview Data Source
If you click on Manage metadata, click on Preview data source to get back
your “original view” of the data.
Manage Metadata
1. Displays the fields in your data source as rows.

2. After connecting to the data source, Tableau captures the metadata


details of the source like the columns and their data types. This is used
to create the dimensions, measures, and calculated fields used in the
View. You can browse the metadata and change some of its properties
for some specific requirements.

3. Click on the down arrow in Row ID under Field Name.


Many options available. E.g. Hide → to hide a field.
If you hide any fields, click on Show hidden fields to “unhide”.

4. To select all Records → click on upper left corner.

One Record → click on the left of the record.

5. The data type of a field is indicated with a symbol.


- Text/ String/ Character
- Numerical/ Integer
- Date values
- Date and Time
- Boolean values (True/ False)
- Geographic values (used with Map)
6. If you click on the symbol, you have the option to change the data type.

7. Up to 1000 rows can be displayed in the data grid.

8. Use Filters to restrict records displayed in the grid.


What did you learn from this Chapter?
1. What you need to know about the Data Source Page?
Chapter 5
Tableau Workspace
Chapter 5 – Tableau Workspace
Now click on Sheet 1.

Workspace area
• The Tableau workspace consists of Menus, Toolbar, Data Pane, Cards
and Shelves and one or more Sheets. Sheets can be worksheets,
dashboards, or stories.
A.Workbook name: A workbook contains sheets. A sheet can be a
worksheet, a dashboard or a story.
B. Cards and Shelves: Drag fields to the cards and shelves in the
workspace to add data to the View.
C. Toolbar: Use the toolbar to access commands, analysis and
navigation tools.
D.View: This is the canvas in the workspace where you will create the
visualization (also referred to as a "viz"). Viz is short for
visualization.
E. Click this icon to go to the Start Page, where you can connect to the
data.
F. Side Bar: In a worksheet, the side bar area contains the Data pane
and the Analytics pane.
G.Click this tab to go to the Data Source page and view the data.
H.Status bar: Displays information about the current view.
I. Sheet tabs: Tabs represent each sheet in the workbook. This can
include worksheets, dashboards and stories.
Pills
The SUM(Sales) and Category are called Pills in Tableau because they look
like medical pills.

Shelves
A Shelve is an area on the visualization screen where you can drop pieces of
data so that Tableau can act on them.

Menu Bar

Even though most of the work in Tableau can be achieved by directly


interacting with items using the mouse, there is also a Menu Bar at the top
that lets the you access additional features and settings.
File Menu
The File Menu contains the key functions Open, Save to, etc.
Reminder: As Tableau Public is free, there are limited choices here.
E.g. Print to PDF and Export will not be available.
Reminder: To save the visualizations, you will be required to sign-in to
Tableau Public Server.
Data Menu
The Paste function presents a quick ad hoc way to add a data table – for
example, from a website. Simply select and copy the table in the original
document and click Paste in Tableau. This will add the data to the workbook
as a new data source.

Worksheet Menu
Using Export, you can take the data out of Tableau by creating an image, a
database file or an Excel crosstab. Duplicate as Crosstab, on the other hand,
opens a new worksheet in Tableau, showing a crosstab view of the data used
in the visualization.
Dashboard Menu
Dashboard actions that add interactivity to dashboards are set up and tweaked
by clicking Actions.

Story Menu
The Story Menu entry lets the you create a story from the worksheets and
dashboards. In a story, contents are arranged sequentially for presentation and
enriched with annotations.
Analysis Menu
Using this Menu, you can create and edit calculated fields. Here, you will
also find options for tweaking table layouts as well as for showing grand
totals, forecasts, and trend lines.

Map Menu
In the Map Menu, you can choose between different background maps. The
Offline option is particularly useful when you have no Internet connection
and would like to access the built‐ in cartographic material.

Format Menu
In this Menu, you can set the font, alignment, shading and other formatting
options. In addition, you can set the overall workbook design and adjust the
cell size.
Window Menu
Use the Presentation Mode option to get the full screen for the dashboard.
Press ESC to cancel.

Help Menu
Via this Menu, you can have access to the Tableau online help, training
videos and sample workbooks.
Tableau Toolbar
When you are creating or editing a View, you can use the toolbar at the top of
the view to perform common actions.
In the Tableau desktop, it is possible to hide or display the Tableau toolbar by
selecting Window Menu → click Show Toolbar.

1. Show Start Page: The start-up screen for Tableau Public.


2. Undo: Undoing the last action. The Undo button keeps track of the
progress. You can undo multiple actions with multiple clicks.
3. Redo: Undo an action and to do to it again, press Redo. You can click
back and forth between Undo and Redo.
4. Save: Save the workbook. It will bring up a Save As window if you
haven’t saved it yet.
5. New Data Source: Connect to a data source. This will take you to the
Connect to Data tab.
6. New Worksheet: Create a new worksheet. This does not erase the
current sheet but instead creates a second one. You can switch between
sheets by clicking the tabs at the bottom of the screen.
7. Duplicate: Makes an identical copy of the current View in canvas work
area.
8. Clear Sheet: All of the dimensions, measures and work in the Pages,
Filters and Marks cards are erased. Word of advice: Sometimes when
you are “stuck”, click on Clear Sheet to start all over again. “New Sheet
→ Fresh or new ideas”.
9. Swap Rows and Columns: To flip the rows and columns. The y-axis
will become the x-axis. Also, all of the fields in the Row shelf will
swap with the Column shelf.
10. Sort by Ascending: Measures will sort from lowest to highest in the
worksheet.
11. Sort by Descending: Measures will sort from highest to lowest in the
worksheet.
12. Highlight: To adjusts how highlighting will be displayed in the
worksheet. Highlighting is used to emphasize the aspects of the
worksheet.
13. Group Members: We can use Group to combine members into higher
level categories. E.g. Group a dimension that contain states, into
regions. Groups are marked with a paper clip icon in the Data pane.
14. Show Mark Labels: Turn on or off labels on the marks.
15. Fix Axes: To fix the range of the axis to whatever is currently
displayed.
16. Fit: How to fit the worksheet within the canvas work area?

• Fit Width will stretch the worksheet to fill the entire horizontal
space of the canvas.
• Fit Height will stretch the worksheet to fill the entire vertical
space of the canvas.
• Entire View will stretch the worksheet to fill the entire space of
the canvas, both vertically and horizontally.
17. Show/ Hide Cards: A series of options from the drop-down arrow. It
allows you to customize the canvas work area. Options include:
• The Marks card
• The Title, Summary and Caption fields
• The Row, Column, Pages and Filters shelves
18. Presentation Mode: The worksheet will go full screen, covering up the
Tableau worksheet interface. You can get out of this view by clicking
the same button at the bottom right of the screen or by simply pressing
ESC.
19. Show Me: Helps you choose a view type by highlighting view types
that work best with the field types in the data. An orange outline around
the recommended chart type, is the best match for the data.
Show and Hide the Side Bar (Data Pane)
The Side Bar contains the Data pane and the Analytics pane when editing a
worksheet. Different panes are visible depending on what is being done in the
View (Data, Analytics, Story, Dashboard, Layout and Format). The most
important thing to know about the Side Bar is that you can expand and
collapse this area in the workspace.

To hide the side bar in Tableau desktop


Click the collapse arrow in the side bar.

To show the side bar on Tableau desktop


Click the expand arrow in the bottom-left of the workspace (in the status bar).

Status Bar Information


The status bar is located at the bottom of the Tableau workspace. It displays
descriptions of menu items as well as information about the current view. For
example, the status bar below shows that the view has 147 marks shown in 1
row and 147 columns. It also shows that the SUM(Sales) for all the marks in
the view is $1.642.502.

You can hide the status bar by selecting Window Menu → Show Status Bar.
The Data Pane
Tableau displays data source connections and data fields for the workbook in
the Data pane on the left side of the workspace.
Data pane
After you connect to the data and set up the data source with Tableau, the
data source connections and fields appear on the left side of the workbook in
the Data pane. Current data source connections appear at the top of the Data
pane. When there is more than one connection available, click a connection to
select it and start working with that data.
Build visualizations by adding fields from the Data pane to the View. Below
the data source connections in the Data pane are the fields that are available
in the currently selected data source. Toggle between the Data and Analytics
panes in a worksheet.
1. The Data pane includes these areas:
Dimensions: Fields that contain qualitative values (such as names,
dates or geographical data). Use dimensions to categorize, segment and
reveal the details in the data. Dimensions affect the level of detail in the
View. Examples of dimensions include dates, customer names and
customer segments.
Typically, dimensions come with blue symbols in Tableau, which
represent discrete variables.

Measures: Fields that contain numeric and quantitative values can be


measured. Can apply calculations and aggregate them. When you drag
a measure into the View, Tableau applies an aggregation to that
measure (by default). Examples of measures: sales, profit, number of
employees, temperature and frequency.
Measures typically (but not always) come with green symbols,
which represent continuous variables.

Note:
In some companies, Salesperson are assigned numbers e.g. 1000 for
John. The Field is numeric in the Dataset. Salesperson will then appear
under Measures and you need to convert to Dimensions. You may have
a similar problem with Fiscal Periods in your Accounting Datasets.
Fiscal Periods could be stored as numbers as opposed to text.

Right click on Salesperson → Convert to Dimension.

Sets: Subsets of data that you define. Sets are custom fields based on
existing dimensions and criteria specified.
Parameters: Values that can be used as placeholders in formulas or
replace constant values in calculated fields and filters.
Field Names: By default, the field names defined in the data source are
displayed in the Data pane. You can rename fields and member names,
create hierarchies and organize the fields into groups and folders.
2. Analytics pane
Options for adding Analytics objects to the view are available from the
Analytics pane or menu. For example, reference lines and bands are
available when you edit an axis. Trend lines and Forecasts are also
available from the Analysis Menu.
3. Columns become Measure and Dimension fields in the View
Data sources contain fields. For relational data sources that you connect
to, the fields are determined by the columns of a table or view. Each
field contains a unique attribute of the data such as customer name,
sales total, product type, and so on. When you start building a
visualization in a worksheet, these columns are available as fields in the
Data pane.
Each field has a data type (can change if needed) and a role: discrete
dimension, continuous dimension, discrete measure or continuous
measure. Each field also includes some default settings such as a
default aggregation of SUM or AVG, depending on the structure of the
current view.
4. Fields that Tableau automatically creates
The Data pane can also contain a number of fields that do not come
from the original data: Measure Names and Measure Values, Orders
(Count), Latitude and Longitude.
5. Measure Names and Measure Values
The Measure Values field always appears at the bottom of the Measures
area in the Data pane and contains all the measures in the data,
collected into a single field with continuous values. Drag individual
measure fields out of the Measure Values card to remove them from the
View.
The Measure Names field always appears at the bottom of the
Dimensions area in the Data pane and contains the names of all
measures in the data, collected into a single field with discrete values.
6. Orders (Count)
The Orders (Count) field is an automatically generated, calculated field
that is simply set to the number 1. That number gets associated with
each row in the data source. By adding the Orders (Count) fields to the
View, the Users will see the summed count of all the rows in a data
source (the number of records). Users can use the Orders (Count) fields
to get quick counts of various dimensions values. Viewing the number
of records can help to see if the data joins are working correctly.
7. Latitude and Longitude (generated)
When Tableau interprets fields to be geographic fields that can be used
with maps, it automatically geocodes the data and includes Latitude
(generated) and Longitude (generated) fields. Users can use these fields
to overlay the data on live maps.
Perform Common Tasks in the Data Pane
1. To select a data source connection for analysis, click the data source
connection name in the Data pane.

To view a context menu for the data source, click Data in the top menu
and then click on the data source in the menu list.

To search for fields in the Data pane, click the Search field and then
type the field name in the text box.
To see the underlying data, click the View Data icon at the top of the
Data pane.

2. Reminder
In cases where Tableau has misclassified a field as a dimension or a
measure, possibly because of the data type, you can convert it and
change its role.
To convert a measure to a dimension, drag the measure and drop it into
the Dimensions area in the Data pane.
Else right click on the field → Convert to Dimension or Measure.

3. Change data fields


When you drag a field into the View, it will have certain default
settings and characteristics. You can customize a field that is already in
the View, just for that instance of the field or can change its settings in
the Data pane to make the field use those settings going forward.

You can control the definition of a field in the View, depending on how
you want to work with that field data.

Note: To change the default settings for a field before you drag it into
the View, right click it. You can then edit its settings and default
properties from its context menu.
4. Data Types
Each field in a data source is assigned a data type. The data type
depends on the type of information stored in the field. Examples of data
types include numerical values (e.g. 3.46), dates and times (10/05/2018
12:40:00 AM) and string (South).

The data type of a field is indicated with a symbol.


- Text/ String/ Character values
- Numerical/ Integer values
- Date values
- Date and Time values
- Boolean values (True/ False)
- Geographic values (used with Maps)
5. Columns and Rows shelves
The Columns shelf creates the columns of a table, while the Rows shelf
creates the rows of a table.

You can place any number of fields on these shelves. When you place a
dimension on the Rows or Columns shelves, headers for the members
of that dimension are related.
Marks
In Tableau, the Marks card provides you with control over how the data is
displayed in the View. The options on this card allow you to change the level
of detail (LOD) as well as the appearance of the marks without affecting the
headers built by fields on Columns and Rows. Take a look at the Marks card
drop-down menu. When you place the pills in the Marks card, the appropriate
icons are placed beside the pill to allow easy identification of how these pills
affect the View.

1. Color/ Colour
Assign colours to marks. On the Marks card, click Colour and then
select a colour from the menu. This updates all marks in the View to the
colour chosen. From the Data pane, drag a field to Colour on the Marks
card. Tableau applies different colours to marks based on the field's
values and members.
2. Size
Suggested size - Unless there are plans on using Size to make the
shapes really large, you should try to make the original shape size close
to 32 pixels by 32 pixels. However, the original size depends on the
range of sizes available in Tableau.
3. Text
Tableau displays the data using text when: The Marks card drop-down
menu is set to Automatic and you place one or more dimensions as the
inner fields on both the Rows and the Columns shelves. You select Text
from the Marks card drop-down menu.
4. Detail
Drop a dimension on Detail on the Marks card to separate the marks in
a data view according to the members of a dimension. Unlike dropping
a dimension on the Rows or Columns shelf, dropping it on Detail on the
Marks card is a way to show more data without changing the table
structure.
5. Tooltip
Drag a field to Tooltip on the Marks card. Click Tooltip on the Marks
card to open the Edit Tooltip dialog box, where Users can add text,
rearrange the tooltip contents and insert more fields.
6. Pages and Filters

The Pages shelf lets you break a View into a series of pages so you can
better analyze how a specific field affects the rest of the data in a view.
When you place a dimension on the Pages shelf, it is adding a new row
for each member in the dimension.

Various types of filters are used in Tableau. They include extract filters,
data source filters, context filters, dimension filters and measure filters.
Extract filters modify the data in the local copy of data set which is
extracted from the data source. Data source filters modify the data
based on given conditions.
7. Blue and Green
Most dimensions will be blue and most measures will be green. Blue
pills typically correspond to discrete data and green pills to continuous
data. If you see a red pill at any point, it means there is an error of some
kind → a dimension or measure is missing or the calculation is
incorrect.
Show Me
The Tableau Show Me window holds most commonly used charts in
Tableau.
Click on Show Me → There are 24 “built in” Charts.

Here is the complete list of chart types from the Show Me menu.
1. Text Table (Crosstab)
Text Table gives same view as the Excel sheet. It will split the data into
rows and columns. Text Table is used to give a simple visualization of
data. The mark type of Text Table is Text.
When to use? Simple data display uses Text Table. Appendix inclusion
would be nice using Text Table. When you want traditional visual, Text
Table is useful.
2. Heat Map
Heat Map is the way of visualizing the data in cross-tab. Heat map
divides the data into different categories.
When to use? Heat Map can be used to compare the two different
measures. You can view the categories of data with different colours
and sizes. E.g. To categorize performance of company in different
years, highlight the performance with the different colours.

3. Highlight Table
The highlight table allows you to apply conditional formatting to a
View. Tableau will automatically apply a colour scheme in either a
continuous or stepped array of colours from highest to lowest. It is great
for comparing a field’s values within a row or column.
When to use? When compare the field value with rows or columns, use
Highlight Table. Transition from the traditional cross-tab to abstract
Heat Map uses this. E.g. Visualize the sales data for different countries
for segments. The colour patterns can used to highlight the best
performer to poor performer.
4. Symbol Map
Tableau is useful in utilizing maps for visualization. There are two
categories of Maps. They are Symbol Maps and Filled Maps. Symbol
Map is a type of mark to represent the data point. Tableau provides
zoom in and zoom out facility.
When to use? Symbol Map is used to represent statistical data as data
points. Examples of Symbol Map: Fast Food and Obesity in America.

5. Maps
Maps are best used for visualizing any kind of location information,
whether it’s postal codes, state abbreviations, country names or own
custom geocoding. If you have geographic information associated with
the data, Maps are a simple and compelling way to show how location
correlates with trends in the data. E.g. Insurance claims by state,
product export destinations by country, car accidents by zip code, and
custom sales territories.
When to use? If you want to see all branches in a country, the states in
that country can filled with a colour to mark the data. Same way the
countries can be marked in a Map to see the branches.
6. Pie Chart
Pie charts are powerful for adding detail to other visualizations. Pie
Chart is used to show the proportional and percentage relationship. It is
an easy way of visualizing the relative value. Pie Chart is the most
meaningful in data visualization. Horizontal bar charts can be replaced
with Pie charts.
When to use? When there are multiple categories of data, you can use
Pie Chart. E.g. To visualize the sales percentage of each state. The Pie
charts are useful to create a story for the data.
7. Horizontal Bar Chart
Horizontal Bar Chart are used to represent the data in bar lines. Bar
lines can be of two types. They are horizontal and vertical. It is a simple
and effective way of visualizing the data.
When to use? Use Horizontal Bar Chart when there is a requirement to
sort data. E.g. To visualize the sorted order of the sales by category.
8. Stacked Bar Chart
A Stacked Bar Chart is a simple bar chart with segmented bars. The
bars in a stacked bar chart represent distinct values of a field on one
axis. Each of these bars is also internally divided into different sections
or segments providing further detail into the field values Both Side-by-
Side Bar and Stacked Bar Charts add a second dimension based on a
standard bar chart. But Stacked Bar Charts tend to show the part-to-
whole relation. By contrast, Side-by-Side Bar Charts focus on the sub-
category comparison on the second dimension.
When to use? Stacked Bar Chart can be used when the data has several
subgroups. The groups can be considered as different dimensions. E.g.
To visualize the profit margins of company which has been sorted.
Each bar has a subgroup such as sales as well as marketing. The
different colours can be used to represent the different subgroups.

9. Side-by-Side Bar Chart


Side-by-Side Bar Charts are a very popular type of bar charts in which
there are multiple bars attached to form a group and this group of
multiple bars is repeated.
When to use? Comparing the different category of data uses Side-by-
Side Chart. E.g. To compare sales of smart watches or video cameras,
you could use Side-by-Side Chart.

10. Treemaps
A Tree Map is a visualization that nests rectangles in hierarchies so you
can compare different dimension combinations across one or two
measures (one for size; one for colour) and quickly interpret their
respective contribution to the whole.
It is one of the most powerful visualizations. It is used to illustrate part-
to-whole relationship and hierarchical data. They are useful in
visualizing thousands of data in a single view.
When to use? Whenever there are huge number of info and
relationship, use this Chart. E.g. When comparing the sale data of
different states across the countries.
11. Circle Views
Circle View is one of the most powerful visualization. It is used for
comparative analysis. The analysis will be represented by circles. You
can customize the view by changing the shapes into triangles, circles or
squares.
When to use? When comparing data with powerful visualization use
Circle Views. E.g. The big circles will represent the most profit and the
small circles will represent the lower profit.

12. Side-by-Side Circle


This is variant of the Circle View. It is by adding more circles to
visualize more measures.
When to use? It is used to compare different category of data in Circle
View. E.g. The Circle View shows profit is very low in a region. Side-
by-Side Chart will display all segment used to calculate profit. This will
help to identify the weaker area where company needs improvement.
13. Line Charts (Continuous and Discrete)
Line Chart is used to visualize the data in a trending manner. Line
Chart will show the trends over the period.
When to use? Line Chart is useful to show case the data in different
periods. E.g. Visualize the electrical usage for period of 12 months.

14. Dual-Line Chart


Dual Line Chart is the extension of the Line chart. In Dual-Line Chart,
the data will be represented in two different angles. Vertical axis is used
to represent the different category.
When to use? It is used to represent the data of different categories.
E.g. To visualize profit and marketing cost last year.
15. Area Charts (Continuous and Discrete)
An Area Chart is a line chart where the area between the line and the
axis are shaded with a color. These charts are typically used to
represent accumulated totals over time and are the conventional way to
display stacked lines.
When to use? When you need to visualize where there are relative
proportions. It is useful to visualize the relations of percentage. E.g.
Comparing the marketing profit of the company’s percentage. It shows
the relations between the different categories.

16. Scatter Plot


Scatter Plot is to visualize data where there are two different measures.
It uses symbols to visualize data. Both axes in Scatter Plot are
measures.
When to use? Scatter Plot is useful to compare different measures of
patterns. The cluster like patterns identified in Scatter Plot are very
useful. E.g. Comparing height and weight of National Football league.
Scatter Plot is powerful to see the cluster of data for height and weight.

17. Histogram
A Histogram is a chart that displays the shape of a distribution. A
Histogram looks like a Bar Chart but groups values for a continuous
measure into ranges, or bins.
When to use? Histogram is very useful when you want to analyze how
the data is distributed.
18. Box-and-Whisker Plot
It is used to visualize data in format of box and plot. Box gives values
between first and third quartile. Whisker gives distance between the
lowest value to first quartile. It gives fourth quartile to the highest
value. To plot these values, you need to find median of the given input.
When to use? Data and Whisker Plot is useful for complex analysis.

19. Gantt Chart


A Gantt chart is a type of bar chart used for project management and is
named after its inventor, Henry Gantt. The chart outlines the tasks to be
performed on the vertical axis and time on the horizontal axis. It is used
to keep a record of actual and estimated completion dates of tasks in a
project plan. Each task can be visualized as a separate data point.
When to use? Gantt Chart is used to depict information in relation to
time. E.g. Time for sending different products to different parts of
country. The chart is commonly used in project management, to see if
various tasks are on schedule.
20. Bullet Graph
A Bullet Graph is a variation of a Bar Graph developed to replace
dashboard gauges and meters. This graph can be represented
horizontally or vertically.
When to use? A Bullet Graph is useful for comparing the performance
of a primary measure to one or more other measures. E.g. Visualizing
the profit percentage of the company. You can play with the size and
colours in this chart to help tell a story.

21. Packed Bubbles


Packet Bubbles is also known as bubble chart. It will represent the
relational values.
When to use? This is a fun visual to create and look at. It illustrates
relational value without regards to axes. The bubbles are packed in as
tightly as possible to make efficient use of space. You can change the
size of the bubbles.

What did you learn from this Chapter?


1. What you need to know about the Tableau Workspace?
Chapter 6
Exploring the Tableau Workspace
Chapter 6 – Exploring the Tableau Workspace
Exploring is fun. You get the opportunity to learn new things and acquire
skills before you start building your first Viz.

Dataset for Tableau (download from TABLEAU Portal) - Global


Superstore.xls.
http://www.tableau.com/sites/default/files/training/global_superstore.zip

Launch Tableau Public → File Menu → Open → Global Superstore.xls.

The start-up screens.

Drag Orders to the Canvas (Note: You can also double click on the Orders).
The Data Source page displays details about the data that Tableau Public is
connected to. Note: The Field Headers and Records found in the Excel File
will be displayed here.
Very important:
1. Before you start building the Viz in Tableau, check to make sure the
number of records read by Tableau = the number of records in the
source file/ dataset.
2. This is because you could have received “bad data”.
3. If there is a mismatch in the number of records, I would recommend
you ask for a “replacement” data set else consider “data cleansing” by
using the Use Data Interpreter.

Exercise 01 – Double click on Category and then double click


on Sales
Note: When you are working on the exercises, you can click on Clear Sheet
button in Tool Bar to clear your View anytime or the Redo/ Undo button to
redo/ undo your actions.
1. Click on Sheet 1.
2. Dimensions → Double click on Category. It will appear in Rows
automatically.
3. Measures → Double click on Sales. It will appear in Marks → Text
automatically.
Category is Blue
Typically, Dimensions come with blue symbols in Tableau, which
represent discrete variables.
SUM(Sales) is Green
Measures typically (but not always) come with green symbols, which
represent continuous variables.
The View shows Total Sales by Category.

Exercise 02 – Double click on Sales and then double click on


Category
1. Clear your Sheet.
2. Measures → Double click on Sales. It will appear in Rows
automatically.
3. Dimensions → Double click on Category. It will appear in Columns
automatically. A Bar Chart will be generated automatically
and nothing appears in Marks.
Exercise 03 – Drag Category to Columns and then drag Sales to
Rows
1. Clear your Sheet.
2. Dimensions → drag Category to Columns.
3. Measures → drag Sales to Rows.
You will get similar results as Exercise 02.
Exercise 04 – Drag Category to Rows and then drag Sales to
Columns
1. Clear your Sheet.
2. Dimensions → drag Category to Rows.
3. Measures → drag Sales to Columns.
A Horizonal Bar Chart will be generated and nothing appears in Marks.
Click on Show Me to hide the “built-in” Charts if it is blocking your
view.

4. Click on Swap Rows and Columns button in Tool Bar to swap from
horizontal bar to vertical bar.

5. Category will now appear in Columns and SUM(Sales) in Rows.

Exercise 05 – Drag Category and Sales to Rows


1. Clear your Sheet.
2. Dimensions → select Category (hold
control
key and
then…).
3. Measures → select Sales (hold
control
key).
Let go the control key. Drop these Fields to Rows.
You will see vertical bars for Sales by Category in the View.
Exercise 06 – Drag Category and Sales to Columns
1. Clear your Sheet.
2. Dimensions → select Category (hold control key).
3. Measures → select Sales (hold control key).
Let go the control key. Drop these Fields in Columns.
You will see horizontal bars for Sales by Category in the Views.

Exercise 07 – Drag Category and Sales to the View


1. Clear your Sheet.
2. Dimensions → select Category (use
control
key).
3. Measures → select Sales (use
control
key).
Let go the control key. Drop these Fields in the View that shows Drop
field here.
There are 3 places. Column, Row and Body. Clear your Sheet. Do this
one at a time.

Drop in Column

Same output as Exercise 06.

Drop in Row
Same output as Exercise 05.

Drop in Body
Same output as Exercise 01.

Exercise 08 – Select Category, Sub-Category, Sales and then


click on Show Me
1. Clear your Sheet.
2. Note: Use control key to select multiple fields.
3. Dimensions → select Category and Sub Category.
4. Measures → select Sales.
Let go the control key. Then click on Show Me to show the 24 Charts.
Chart 7 has a red box. This is the Chart recommended by Tableau based
on the Fields you have selected.
5. Now click on the 1st Chart, then 2nd Chart, 3rd Chart, 6th Chart, 7th
Chart, 8th Chart, 9th Chart, 10th Chart, 11th Chart, 12th Chart, 21st Chart
and finally 24th Chart.
Tableau gives a different view for each of the Chart.
Tableau is also smart enough to know how to update the Columns,
Rows and Marks.
6. E.g. 1st Chart – text tables.
7. E.g. 9th Chart – side-by-side bars.

8. E.g. 24th Chart – packed bubbles.


Exercise 09 – Select Category, Country, Sub-Category, Sales
and then click on Show Me
1. Clear your Sheet.
Note: Use control key to select multiple fields.
2. Dimensions → select Category, Country and Sub Category.
3. Measures → select Sales.
4. Then click on Show Me to show the 24 Charts.
Chart 4 has a red box. This is the Chart recommended by Tableau based on
the Fields you have selected but I want you to select Chart 5.
A map view is automatically selected because the Country field is a
geographic field.
Exercise 10 – Double click on Measure Names
1. Clear your Sheet.
2. Dimensions → Double click on Measure Names.
Measure Names will automatically appear in Columns.
Measure Values will automatically appear in Marks.

Exercise 11 – Double Click on Measure Values


1. Clear your Sheet.
2. Dimensions → Double click on Measure Values.
You will get a Bar Chart.
Measure Names will automatically appear in Columns.
Measure Values will automatically appear in Rows and Marks.
Exercise 12 – Double click on Rows or Columns and type in the
Field Name
1. Clear your Sheet.
2. Rows or Columns → double click inside and type in the Field Name
(case sensitive).

3. As you type, Tableau displays the available “matching” Fields and you
can then select the Field.
4. If what you type is incorrect, Tableau will show the Pill in red.

Exercise 13 – Double click on Category and then Segment. Next


double click on Sales
1. Clear your Sheet.
2. Dimensions → Double click on Category and then Segment. Category
will appear in Rows and Segment in Columns
automatically.
3. Measures → Double click on Sales. It will appear in Marks → Text
automatically.
For Totals, you have 3 options:
• Row Total
• Column Total
• Row and Column Total
5. In the Data/ Analytics Pane.

6. Select the Analytics Pane → double click on Totals. You will get Row
and Column Total.

7. Undo your actions.


8. Drag the Totals to the View.
9. You can then choose Column Grand Totals or Row Grand Totals.
Exercise 14 – Drag Category and Sub-Category to Rows. Drag
Sales to Columns. Drag Sales to Colour, Size and Label in
Marks. Drag Discount, Profit, Quantity and Shipping Cost to
Details in Marks. Click on Tool Tip and change Discount: to
Rebate:. Lastly, click on Colour, Edit Colours
1. Clear your Sheet.
2. Dimensions → drag Category and Sub Category to Rows.
3. Measures → drag Sales to Columns.
4. Measures → drag Sales to Colors, Size and Labels in Marks.
5. Measures → drag Discounts, Profit, Quantity and Shipping Cost
to Detail in Marks.
6. Marks → click on Tool Tip and change Discount: to Rebate:.
7. Marks → Select Colour → Edit Colour → Palette → drop down
→ select Red Blue Diverging → click OK.

8. You will see the sales value for each bar.


9. The size of the bar is relative to the sales value.
10. And when you hover the cursor over the bars, this is what you will see.

Exercise 15 – Drag Category and Sub-Category to Columns.


Drag Sales to Rows. Drag Sales to Label and Colours in Marks.
Lastly, click on Colour, Edit Colours
1. Clear your Sheet.
2. Dimensions → drag Category and Sub Category to Columns.
3. Measures → drag Sales to Rows.
4. Measures → drag Sales to Label and Color in Marks.
5. Marks → click on Color → Edit Colors → drop down on
Palette and select Gold Purple Diverging → click OK.

6. When the Marks card drop-down menu is set to Automatic, Tableau


automatically select the best mark type for your data view. The mark
type that is automatically selected is determined by the inner fields on
the Rows and Columns shelves.
7. Marks → click on the drop down and you can select different
Charts. Select Line.

8. Bar vs Line.
What did you learn from this Chapter?
1. You learn to explore how you can work in the Tableau Workspace.
2. There were 15 different exercises to practice and acquire skill sets.
Chapter 7
4 Pivot Tables, 3 Pivot Charts and 1
Dashboard built using Microsoft
Excel
Chapter 7 - 4 Pivot Tables, 3 Pivot Charts and 1 Dashboard
built using Microsoft Excel
In Chapter 7, there are 4 Pivot Tables, 3 Pivot Charts and 1 Dashboard built
from the Global Superstore dataset used in this book.
The objective of this chapter is to show that you can use Microsoft Excel
for the visualization. You may ask “If Microsoft Excel can be used, why
should anyone be looking at Tableau?”. I had the same reservations as I am a
trainer for Microsoft Excel Pivot Tables. Learn Tableau. You will have the
opportunity to acquire new skills sets, broaden your horizon and possibly
open new job opportunities as Tableau can handle big data. Once you are
familiar with Tableau, you can take on projects where the visualizations are
far more complex and demanding.
In this e-book:
1. You will learn how to build similar output in Chapter 8 in Tableau.
This learning experience will expose you to many of the Menus,
Functions and Commands in Tableau.
2. Once you have done the above exercises, you will also learn other areas
in Tableau to enhance your skills sets with data visualization.
3. If you want to build these Pivot Tables, please download the dataset
from Tableau Portal – Global Superstore.xls.
http://www.tableau.com/sites/default/files/training/global_superstore.zip
Save the file as Global Superstore.xlsx (for Excel Pivot Table).
Row 1 is the Field Header (Column A to X).
Row 2 to Row 51291 are the Records.
I have built 8 different exercises using Microsoft Pivot Tables, Pivot Charts
and Dashboard for the data visualization.
Exercise 01 – Sales and Sales % by Country (sorted in
descending order)

Exercise 02 – Sales by Ship Mode by Country (rounded to the


nearest dollar and sorted by First Class)
Exercise 03 – Sales by Country by Year (rounded to nearest
thousand and sorted by Grand Total)

Exercise 04 – Sales by Category by Sub-Category (in thousands


and sorted by sales value in descending order)
Exercise 05 – Donut Chart. Sales by Ship Mode (First Class,
Same Day, Second Class and Standard Class)

Exercise 06 – Lollipop Chart. Sales by Ship Mode (Standard


Class, Second Class, Same Day and First Class)
Exercise 07 – Sparklines. Sales by Sub-Category by Market
(2013 to 2015 excluding Canada and EMEA)

Exercise 08 – Dashboard. Slice by Ship Mode


What did you learn from this Chapter?
1. You can do the visualization using Microsoft Excel.
2. There were 8 exercises to practice and acquire skill sets.
Chapter 8
Building similar Tables and Charts
in Chapter 7 using Tableau Public
Chapter 8 - Building similar Tables and Charts in Chapter 7
using Tableau Public
The objective of this chapter is for you to learn how to use Tableau to do
the visualization.
Just like how you first started to learn to use the various Menus, Functions
and Commands in Excel before you were able to take on more “complex
tasks”. In short, complete these 7 exercises to build the “core” skills needed
to work with Tableau.

Dataset for Tableau (download from TABLEAU Portal) - Global


Superstore.xls.
http://www.tableau.com/sites/default/files/training/global_superstore.zip

Launch Tableau Public → File Menu → Open → Global Superstore.xls.

The start-up screens


Drag Orders to the Canvas (Note: You can also double click on the Orders).

The Data Source page displays details about the data that Tableau Public is
connected to.
Note: The Field Headers and Records found in the Excel File will be
displayed here.
Very important
4. Before you start building the Viz in Tableau, check to make sure the
number of records read by Tableau = the number of records in the
source file/ dataset.
5. This is because you could have received “bad data”.
6. If there is a mismatch in the number of records, I would recommend
you ask for a “replacement” data set else consider “data cleansing” by
using the Use Data Interpreter.

Exercise 01 – To verify the number of records read by Tableau


1. Click on Sheet 1.
2. Measures → drag Orders (Count) to Text in Marks.
You should see number of records in the View = 51,290.

3. Undo the action before proceeding with the “actual job”.


You can use Ctrl Z to Undo or the Toolbars below to Undo and Redo
your actions.

4. However, I would recommend you do this to verify the number of


records:
a. Create a formula. Call it → Number of Records.
b. To create this Formula Field. Select Analysis Menu → Create
Calculated Field.
c. Change Calculation1 (default name) with → Number of Records.

d. In the formula editor (body of the formula) enter 1.


Make sure you see the message → The calculation is valid → click
on OK.

e. Measures → Drag Number of Records to Text in Marks.


The = indicates it is a Calculated Field (Formula Field).
f. I would recommend you to build this Calculated Field →
Number of Records → for every Workbook. You will use it in
the Viz.
Exercise 02 – Sales and Sales % by Country in descending
order
Objective: To show which country had the highest sales.

Steps Required:
1. Clear your Sheet and re-use Sheet 1.
2. Dimensions → drag Country to Rows.

3. Measures → drag Sales and drop on Abc (beside the Countries in the
View). Do not drop on the dashed vertical or horizontal
lines in the View else a chart will automatically be
generated.
The vertical dashed line and the corresponding chart.

The horizontal dashed line and the corresponding chart.

4. To get the % of Total Sales, you need to do the following:


a. Select Analysis → click on Create Calculated Field.
Menu
b. Change the → Calculation1 (default Name) in the box to %
name Sales. The % Sales will be the Name used for the
Field in the View.
c. Press Tab to go to formula editor/ calculation editor (formula
section) where you will build/ write the formulas for Tableau.
In the formula section, type S and then select # Sales.
d. Make sure you see the message → The calculation is valid → before
you click on OK.

e. If you see this message: The calculation contains errors, fix this
error before you click on OK.
5. The % Sales will now appear in Measures with an = sign.
Drag this Field → % Sales and drop it on the Sales Value in the View.

Reminder: Do not drop on the dashed line in the View else Tableau
will automatically generate a Chart.
You should now see this screen:

6. Measure Values (below Marks) → move SUM(% Sales) below


SUM(Sales) (look for the red arrowhead so that the View will show
Sales followed by % Sales.
To show % Sales in the View.
Measure Values → right click on SUM(% Sales) → select Quick Table
Calculation → Percent of Total.

7. To sort the Sales in descending order. Highlight the Sales Field in the
View → click on the Sort Descending Icon in the Toolbar.
8. To get Grand Totals for Sales and % Sales.
Analysis Menu → click on Totals → Show Column Grand Totals.

9. You can use any Title for your worksheet but it is recommended that
you give the worksheet descriptive names relating to the contents that is
included in the worksheet. Doing so will make it much easier for you
when you want to add those visualizations to a dashboard or to a story.
To give your report a Title:
a. Right click on Sheet 1 in the View → Edit Title.
b. Change <Sheet Name> to: Sales and Sales % by Country in
descending order.
c. Then click on OK.

10. All the figures have been automatically rounded-up.


To show the figures with 2 decimals:
Marks→ right click on Measure Values → select Format → Pane →
Default → Numbers → Number (Custom) → Decimal places: 2.
Then click outside the “box”.

11. This is the final output.


Exercise 03 – Sales by Ship Mode by Country. Sorted by First
Class
Objective: To rank the sales generated by First Class.

Steps Required:
1. Click on New Worksheet to get Sheet 2.
2. Dimensions → drag Country to Rows and Ship Mode to Columns.

3. Measures → drag Sales to Text in Marks.


4. This will automatically populate the View with the sales values.

5. We want to show zero (0) for no sales rather than leave it blank.
a. To show zero (0) for no sales.
b. Analysis Menu → click on Create Calculated Field → you will see
Calculation1 in the box → Change to Zero Sales.
c. The Zero Sales will be the Field Name.
d. In the Formula Editor/ Section, enter this Formula:
(ZN(LOOKUP(sum([Sales]),0)))
e. For the expression, type in the 1st character of the field required for
the formula and then select the field.
f. Ensure you see this message “The calculation is valid” before you
click on OK.
g. The Calculated Field (Formula) will appear in Measures with a =
sign.

6. Marks → drag out SUM(Sales) and drag Zero Sales in Measures


to Text.

Ship Mode with no Sales will now show 0 instead of blanks.


7. To get Row and Column Grand Totals → click on Analytics Pane →
then double click on Totals.

Reminder: If you drag the Totals to the View, you will see this screen.
You then have the option to select Column Grand Totals or Row Grand
Totals.

8. View → to sort the First Class in descending order, select First


Class and click on the Sort Descending Icon from the
Toolbar.

9. View → to rotate the labels for Ship Mode, select any of the
labels in Ship Mode, right click → Rotate Label.
10. Change the Name of Sheet 2 in the View to:
Sales by Ship Mode by Country. Sorted by First Class
11. This is the final output. The figures are automatically rounded by
Tableau to the nearest dollar.

Exercise 04 – Sales by Country by Year. Sorted by Grand Total


(nearest thousand)
Objective: To rank the total sales from 2015 to 2011.
Steps Required:
1. Click on New Worksheet to get Sheet 3.
2. Dimensions → drag Ship Date to Columns and Country to Rows.

3. Measures → drag Sales to Text in Marks.


This will automatically populate the View with the sales values.

4. To round the sales values to the nearest thousand (474,161.19 →


474,000), right click on SUM(Sales) in Marks → select Format →
Format SUM(Sales) → Pane → Default → Numbers → Custom →
Format: Enter the format #,###,",000"

This is similar to the Custom Format in Excel.

5. We will now proceed to the do the following:


a. Insert Row and Column Grand Total.
Select Analytics Pane → double click on Totals.
b. Sort Grand Total in Descending Order.
Select Grand Total → click on the down arrow.

c. Sort the Year in Descending Order:


Columns → right click on Ship Date → Sort → Sort Order →
Descending.

6. Rename Sheet 3 in the View to:


Sales by Country by Year. Sorted by Grand Total (nearest thousand)
7. This is the final output.

Exercise 05 – Sales by Category by Sub-Category (from 2011 to


2013) sorted by Total Sales (in thousands)
Objective: To show total sales by Category by Sub-Category from 2011 to
2013.
Steps Required:
1. Click on New Worksheet to get Sheet 4.
2.Dimensions → drag Category to Columns and Sub-Category to Rows.

3. Measure → drag Sales to Text in Marks.


This will automatically populate the Views with the Sales values.
4. To show the sales values in thousands (474,161.19 → 474):
Marks→ right click on SUM(Sales) → select Format → Format
SUM(Sales) → Pane → Default → Number (Custom) →
Decimal places: 0 → Display Units: Thousands (K). Then go to
Custom (remove only the K).

5. We will now proceed to the do the following:


a. Insert Row and Column Grand Total.
Select Analytics Pane → double click on Totals.
b. View → sort Grand Total in Descending Order.

6. View → hide the text Category → select Category → right click


→ Hide Field Labels for Columns and then drag the field
Technology in front (hold the mouse and drag).

7. Dimensions → to exclude 2014 from the analysis, drag Order Date to


Filters → select # Years→ click on Next → click on 2011,
2012 and 2013 → click OK.
8. Rename Sheet 4 to:
Sales by Category by Sub-Category (from 2011 to 2013).
Sorted by Total Sales
(in thousands)
9. This is the final output.

Exercise 06 – Donut Chart. Sales by Ship Mode (First Class,


Same Day, Second Class and Standard Class)
Objective: Use donut chart to display sales contribution by Ship Mode.
What is a Donut Chart?
Technically speaking, Donut Chart is a pie chart with a hole in the middle.
We can use that hole to put a nice label that usually comes up ugly in the pie
chart.
Steps Required:
1. Click on New Worksheet to get Sheet 5.
2. Click on Show Me.
Donut Chart is not included in Show Me. Users are required to build it.

3. To create a donut chart, we first need to know the dimension on which


we want to segregate and measure to define the proportion. In our
example, the Ship Mode will be used as the dimension and Sales as the
measure.
a. Marks → select Chart Type as Pie.
b.Dimensions → drag Ship Mode to Colour.
c. Measures → drag Sales to Size and Label and drag Quantity to
Rows.
d.Rows → select the SUM(Quantity).

e. Right click to change the default aggregation → Measure (Sum)


→ from Sum to Minimum.

4. Measures → once again drag Quantity and drop it on the Rows shelf
after the MIN(Quantity).
You will see SUM(Quantity). Then change the default aggregation in
Measure (Sum) → from Sum to Minimum (right click to do this).
There will be two MIN(Quantity) in Rows now.

5. Rows → right-click on 2nd copy of MIN(Quantity) and select


“Dual Axis” (to combine the 2 pie charts).
6. Marks → select the MIN(Quantity) (2) and remove/ drag out the
following: Ship Mode, both the SUM(Sales).

7. Marks → once again, select the MIN(Quantity) (2), reduce the


size of the pie chart and then select the colour of the pie
chart → same as the background colour (white colour in
this case).
8. View → right-click on the Min. Quantity axis (header) on the left
and de-select Show Header. Do this for the Min. Quantity
axis on the right as well. You are removing both the axis
(headers) for Min. Quantity.

9. This is how the donut chart will look like now. Drag to the right to
increase the size of the Donut.
10.Marks → you can adjust the Size for both the MIN(Quantity) and
MIN(Quantity) (2) to get the ideal size for the donut.
11. To show the % instead of dollar value:
Marks→ select MIN(Quantity) → right click on SUM(Sales) Text →
Quick Table Calculation → Percent of Total.
12. To show the Sales value and Ship Mode for each of the segment, drag
Sales in Measures and Ship Mode in Dimensions to Label.

13. Rename Sheet 5 in View to:


Donut Chart
Sales by Ship Mode: First Class, Same Day, Second Class and Standard
Class
14. This is the final output.
Exercise 07 – Lollipop Chart. Sales by Ship Mode (First Class,
Same Day, Second Class and Standard Class)
Objective: Use lollipop chart to display sales contribution by Ship Mode.

What is a Lollipop Chart?


The Lollipop Chart is a composite chart with bars and circles. It is a variant
of the bar chart with a circle at the end, to highlight the data value.
Comments:
Lollipop Chart does not add any new insights if we were to compare with a
simple Bar Chart but it gives a different way of presenting some insights. It
makes the Users more interested in the Viz. It adds some fun and new
thoughts too.
Steps Required:
1. Click on New Worksheet to get Sheet 6.
2. Lollipop chart is not included in Show Me. Users are required to build it.
3. To create a Lollipop Chart:
Dimensions → drag Ship Mode to Rows.
4. Measures → drag Sales to Columns.
5. Marks → select Bar to build a simple Bar Chart (drop down on
Automatic).

6. Create a dual bar chart.


Hold the Ctrl key and drag the aggregate field SUM(Sales) in the
Columns shelf next to itself (to make a duplicate).

7. Select the duplicate SUM(Sales) in the Column shelf → right click →


select Dual Axis.
8. View → right click on text Sales and select Synchronize Axis.

9. Marks → select SUM(Sales) (2) and change from Bar to Circle.


10.Marks → adjust the size of the two charts as follows by adjusting
the respective sizes under Size in Marks.
a. Make the Bar Chart 1st chart] thinner by selecting SUM(Sales).
b. Make the Circles (2nd chart) bigger by selecting SUM(Sales) (2).

c. The Shape tab of the second chart – SUM(Sales) (2) gives a


variety of icons to choose from hence giving control on how you
would like to present your data.
Select Circle → Shape and click on Shape.
11.Marks → select Sum (Sales) (2).
12.Measures → drag Sales to Colour in Marks.
13.Marks → click on Colour → Edit Colours → Palette → select
Gold-Purple Diverging.

14.View → the text Sales appears twice (header & footer). To


remove the text Sales in the header, right click on Sales →
edit Axis → Axis Titles → blank the title Sales → click on
X to exit.
15. Rename Sheet 6 to:
Lollipop Chart – Sales by Ship Mode
First Class, Same Day, Second Class and Standard Class
16. This is the final output.

Exercise 08 – Sparklines. Sales Q1 to Q4 for 2013 to 2015 by


Sub-Category by Market (excluding Canada and EMEA)
Objective: To display sales revenue by Market by Quarters from 2013 to
2015.
What is a Sparklines Chart?
A Sparklines Chart is characterized by its small size and data density.
Typically displayed without axes or coordinates. Sparklines present trends
and variations associated with some measurement, in a simple and condensed
way.

Steps Required:
1. Click on New Worksheet to get Sheet 7.
2. Sparklines Chart is not included in Show Me. Users are required to
build it.
3. To create a Sparklines Chart:
a. Dimensions → drag Market and Ship Date to Columns.
b. Dimensions → drag Sub-category to Rows.
c. Columns → Click on +YEAR(Ship Date) and you will get
+QUARTER(Ship Date). Drag out -YEAR(Ship
Date).
d. Measures → drag Sales to Rows.

4. Dimensions → drag Ship Date to Filters. Double click on # Years and


select 2013, 2014 and 2015 → click on OK.
5. Dimensions → then drag Market to Filter and uncheck Canada and
EMEA to exclude from the Viz → click on OK.

6. Marks → click on Color. Then click on Markers: → All.


7. View → right click on Sales → Edit Axis → select Independent
axis ranges for each row or column → uncheck Include
zero. Click on X to close this screen.
8. View → right click on Sales and uncheck Show Header.

9. Make the column and row width smaller. Place the mouse in-between
the lines and drag
in.

10. Right click on the lines in the View and select Format → Format Font
→ Borders.

11. Do this for Sheet, Rows and Columns. You are basically setting all to
None to remove the lines except for Pane and Header.
12. Rename the Sheet in View to:
Sparklines
Sales Q1 to Q4 for 2013 to 2015 by Sub-Category by Market excluding
Canada and EMEA
13. This is the final output.
Exercise 09 – Tableau Public Server
To save your workbook
1. As you are using Tableau Public, you will not be able to save the
Analysis/ Viz in your local machine.
2. You have to save in the Tableau Public Server or you can choose not to
save.
3. This was covered in Chapter 2.
4. Please note to save your Viz, you have to Sign-in to Tableau Public.
5. Select File Menu → Save to Tableau Public As → Exercises-Chapter 8.
6. You will see your last Viz.
7. If you click on Edit Details → Show worksheets as tabs → Save → all
7 Sheets will appear as tabs.

8. Place your cursor on your profile picture → explore the following:


• My Profile
• Settings
• Download the App
• Sign Out
9. You can also view how much space you have used to date.

10. When you click on the magnifying glass, you can do a Search in
Tableau Public.
Search by Key Word or Authors.
Type in Narayanan and Enter. You get so many Viz done by
Narayanan.
Type in Stock and Enter. You get to see so many Charts on Stock.

11. There is so much you can learn from the Tableau Public Server.
Take time and explore → Gallery, Authors, Blog, Resources, Activity
and About.

Allways remember. Learning is fun and it is blessing to learn from


successful people.
12. Click on Authors. View the Profile and Follow these Authors.
13. Please remember to Sign Out from Tableau Public Server.

What did you learn from this Chapter?


1. You completed 8 different exercises to build your skill sets when
working with Tableau.
2. You learned how to save your work in the Tableau Public Server.
3. You learn there is so many things you can do when you are logged into
the Tableau Public Server.
4. You learn that you have a community that is willing to share their Viz
and knowledge with you.
Chapter 9
Build 7 popular charts to acquire
additional skills sets
Chapter 9 - Build 7 popular charts to acquire additional skills
sets
The objective of this Chapter is to develop additional skill sets when
building charts in Tableau.
1. We will learn to build 7 charts as follows:
a. Bar Chart
b. Treemaps
c. Maps
d. Step Chart
e. Bubble Chart
f. Waterfall Chart
g. Bar and Line Chart
2. Do not assign any Title when you build the charts. We will learn to
assign Titles when building the Dashboard in Chapter 10.
3. We will use 7 Sheets for the 7 charts.
4. Close Tableau Public.
Then launch Tableau and Open the Excel File: Global Superstore.xls.
This Excel file has 3 Worksheets: Orders, Return and People.

5. Drag Orders to the Canvas.


Next drag People to the Canvas and drop People after Orders.
The Tables are “linked automatically” based on a common key field.
Note: You can add/ change the links, if required.

6. Click on the “line” connecting Orders and People.


7. Options available under Edit Relationship.

8. In Sheet 1, you can see all the fields for both Tables. When you click on
the down arrow for Orders and People, it will collapse the Tables. Side
arrow will expand the Tables.

Exercise 01 – Bar Chart to show Sales by Categories by Sub


Categories (in descending order)
Bar Charts are a staple in data visualization. They are often the first chart
type that comes to mind when comparing quantities across discrete groups
such as sales amount for different product categories.
The length of the bars is proportional to the value that each category
represents.

Steps Required:
a. Measures → double click on Sales.
b. Dimensions → double click on Category.
c. The Sales will appear in Rows and Category in Columns automatically.

d. Dimensions → drag Category to Colour in Marks.


e. Measures → drag Sales to Label in Marks.
f. View → right click on the text Category and sort descending.

g. As you hover the cursor over the Bars, Tableau will display details
about the Bar.
h. This is the Bar Chart build showing Sales by Categories.

i. Dimensions → drag Sub-Category to Columns and drop it after


Category and look at the visualization.
Looking good. We get to see the sales breakdown within each Category
by Sub-Category.
j. View → right click on Sub-Category and select Sort descending.
k. You want to highlight the Sub-Categories during your presentation.
l. Analysis Menu → to use highlighter → click on Highlighters → Sub-
Category.
The Highlight Sub-Category will appear on the right side of the screen.

m. Now when you click any Sub-Category in the Highlight Sub-Category,


the Sub-Category in the View is highlighted.
This makes it easier for the audience to follow your presentation.
n. This is the final output.

Exercise 02 – Treemaps to show Sales by Sales Person (Sales


Value and % Sales)
Use Treemaps to display data in nested rectangles. Use dimensions to define
the structure of the Treemaps and measures to define the size or colour of the
individual rectangles. Treemaps are a relatively simple data visualization that
can provide insight in a visually attractive format.

Steps Required:
a. New Sheet → Sheet 2.
b. Measures → double click on Sales.
c. Dimensions → double click on Person.
The Sales will appear in Rows and Person in Columns automatically.
d. Show Me → click on Treemaps. Chart number 10.

e. Dimensions → drag Person to Colour in Marks.


f. Measures → drag Sales to Label.
g. This is what you should see now.

h. We need to build a formula for the % Sales.


Click on the down arrow in the Data Pane → Create Calculated Field.
i. Build this Formula (Analysis → Create Calculated Fields).
% Sales → [Sales].
Remember: You can enter [Sales] or type s for Sales or drag this
field from Measures.

j. Measures → drag % Sales to Label in Marks.


k. Marks → select SUM(% Sales) → right click → Quick Table
Calculation → Percent of Total.

l. This is the final output.


You see a 1 null because there is one salesman with no sales.
Exercise 03 – Map to show sales by Geographical Areas
Tableau Maps are very useful to visualize geographical data. Keep in mind
that Maps, like any other type of visualization, serve a particular purpose.
They answer spatial questions. To get the map of Malaysia for Tableau:
https://public.tableau.com/profile/angah.iezafham89#!/vizhome/MapofMalaysia/MapofMa
laysia
Steps Required:
a. Ensure internet access is available.
b. New Sheet → Sheet 3.
c. Dimensions → drag Country to Detail, Colour and Label in Marks.
d. Dimensions → drag State to Label in Marks.
e. Measures → drag Sales to Label in Marks.
f. View → You could use the + - to zoom in and out for any
Country else select any Country on the right and zoom in
on the States within the Country.
g. This is the final output

Exercise 04 – Step Chart to chart daily Sales for December


2014
A step area chart tells you the increase and decrease in value compared to the
previous day or month. For each day or month, the step line connects the
previous value with the next value.
Users could use this knowledge to plot share prices by counters for a specific
time frame.
This will be covered in more detail in Chapter 14.

Steps Required:
a. New Sheet → Sheet 4.
b. Dimensions → drag Category to Colours in Marks and Rows.
c. Measures → drag Sales to Rows (drop the field after Category).
d. Dimensions → drag Ship Date to Columns.

e. Click on the + YEAR(Ship Date) to get QUARTER(Ship Date) and


click on + QUARTER(Ship Date) to get MONTH (Ship Date) and click
on + MONTH(Ship Date) to get DAY(Ship Date). Then drag out -
YEAR(Ship Date), -QUARTER(Ship Date) and -MONTH (Ship Date).
You are then left with DAY(Ship Date).

f. Dimensions → drag Ship Date to Filter.


Double click on # Month/ Year → Select December 2014 →
click OK.

g. Dimensions → drag Category to Label in Marks.

h. Tool Bar → Fit → select Entire View & then Click on Presentation
Mode to see the full Chart.
i. Click on this Icon to Exit Presentation Mode. You can also click on the
ESC key to exit.

j. Marks → click on Path → you will see 3 Line Type → click on Step.
k. Marks → drag out Category (T). Makes the Viz look better.
l. This is the final output.

Exercise 05 – Bubble Chart to show sales by Category by


Segment and Sales % within each Segment
Bubble chart is used to show data in bubbles or circles with varying sizes and
according to a colour scheme. A bubble chart has the ability to show multiple
variables through its design. Dimensions field values are represented by
individual bubbles and measure field values define the size and colour of the
bubble.
a. New Sheet → Sheet 5.
b. Dimensions → drag Segment to Columns.
c. Dimensions → drag Category to Colour and Label in Marks.
d. Measures → drag Sales to Size and Label in Marks.
e. Marks → drop down on Automatic → select Circle.
f. Marks → click on Label → then select Allow labels to overlap
other marks.

g. We need to create a formula to get the % Sales.


Analysis → Create a Calculated Field → % Sales by Segments and
Menu enter the
following:
if [Segment]= 'Consumer' then [Sales]
ELSEIF [Segment]= 'Corporate' then [Sales]
ELSEIF [Segment]= 'Home Office' then [Sales]
else 0 END

h. Then drag this calculated field to Label in Marks.


Marks → right click on SUM(% Sales by Segment) → Quick
Table Calculation → Percent of Total.

i. Marks → once again right click on SUM(% Sales by Segment) →


Compute Using → Table (down) (to get 100% within each
Segment).
j. Marks → finally, right click on SUM(% Sales by Segment) →
Format → Pane → Default → Numbers → Percentage →
Decimal Places → 0.

k. This is the final output.


Exercise 06 – Waterfall Chart to show profit % by Sub-
Category over Total Profit
Waterfall charts effectively display the cumulative effect of sequential
positive and negative values. It shows where a value starts, ends and how it
gets there incrementally.

Steps Required:
a. New Sheet → Sheet 6.
b. Dimensions → drag Sub-Category to Columns.
c. Measures → drag Profit to Rows.
d. Marks → select Bar.
e. Row → right click on SUM(Profit) → Quick Table Calculation
→ Running Total.

f. Measures → drag Profit to Colour in Marks.


g. Marks → select Gantt Bar.
h. Create a Calculated Field as follows and drop it on Size in Marks. Call
your Field → Waterfall and enter –[Profit] in the formula section.

i. Marks → select SUM(Profit) → Color → Edit Colour → Palette


→ Automatic → Stepped Color 2 → OK.

j. Measures → drag Waterfall to Label in Marks.


k. Marks → right click on label SUM(Waterfall) → Quick Table
Calculation → Percent of Total.

l. This is the final output.


Exercise 07 – Bar and Line Chart to show Sales and Profit by
Months for 2014
Combination charts are views that use multiple mark types in the same
visualization. For example, you may show sum of profit as bars with a line
across the bars showing sum of sales.
Combining a line chart with a bar chart in Tableau is a good way to show two
related metrics together.
Steps Required:
a. New Sheet → Sheet 7.
b. Dimensions → drag Ship Date to Columns → right click → select the
first Month (blue pill).
You will see 2 Months (first is discrete/ blue pill and second is
continuous/ green pill).

c. Measures → drag Sales and then Profit to Rows.


d. Mark → select SUM(Sales) → change from Automatic to Bar.
e. Row → right click on SUM(Profit) → select Dual Axis.
f. View → right click on Profit → Synchronize Axis.

g. Marks → highlight SUM(Sales) → drag Sales from Measures and


drop in Label.
h. Marks → highlight SUM(Profit) → drag Profit from Measures
and drop in Label.
i. Rows → right click on SUM(Sales) →Format → Pane →
Numbers → Number (Custom) → Decimal places → 0 →
Display Units → Thousands (K).

j. Do the same formatting for Profit as what you did for Sales.
k. Menu → Fit → select Fit Width.
l. This is the final output

Save the workbook to Tableau Public


Workbook Title: EXERCISES-CHAPTER 9
Make sure you have logged into Tableau Public else you cannot save
your Viz.

What did you learn from this Chapter?


1. You learn to build 7 amazing Viz.
2. You acquired new and powerful skill sets when working with Tableau.
3. You learned how to save your work in the Tableau Public Server.
Chapter 10
Putting the Viz/ Charts together to
build a Dashboard and share with
others
Chapter 10 - Putting the Viz/ Charts together to build a
Dashboard and share with others
The objective of this Chapter is to learn how to build a Dashboard in
Tableau and share with other parties (via Power Point and Tableau
Reader).
What is a Dashboard in Tableau?
A dashboard is a consolidated display of many worksheets and related
information in a single place. It is used to compare and monitor a variety of
data simultaneously. The different data views are displayed all at once as
opposed to navigating to separate worksheets.
Best Practices for Effective Dashboards
Know your purpose and audience. The best visualizations have a clear
purpose and work for their intended audience. Limit the number of views.
Show filters. Enable highlighting.

Building the Dashboard


Steps Required:
1. Ensure you have logged on to Tableau Public Server.
2. Launch Tableau. Click on File Menu → Open from Tableau Public →
EXERCISES-CHAPTER 9.
All files saved by you in the Tableau Public Server will be displayed.

3. We will now proceed to build a Dashboard.


Click on New Dashboard.

4. Tiled or Floating?
Tiled objects are arranged in a single layer grid that adjust in size based
on the total dashboard size and the objects around it.
Floating objects can be layered on top of other objects and can have a
fixed size and position.
For this exercise, select Tiled (default).

5. Double Click on Sheets 1, 2, 4 and 5.


6. All 4 Sheets may not be well spaced out in the Dashboard. However,
you could space out the Dashboard by changing the Size (set Maximum
Size Width @ 1250 px and Height @ 860 px) or uncheck Maximum
size.

7. If for some reason, you do not require Legends in the Dashboard, select
the Legend and click on X. Best to keep the Legends.

8. Rename the Sheet (right click on the Title → Edit Title → OK) as
follows:
Sheet 1 – Sales by Category by Sub-Category
Sheet 2 – Sales by Sales Person
Sheet 4 – Sales by Category
Sheet 5 – Sales by Segment
Tableau will automatically change the Titles in the Views for the 4
Sheets above.
9. We now have a good looking and informative Dashboard.
10. Let us make this dashboard even better looking.
a. For each of the Viz → click on the down arrow (More Options) →
Fit → select Entire View.

b. Enter a Title for your Dashboard → click on Show dashboard title


→ right click → Edit Title → Sales Performance.
c. Now draw a border for each of the Viz. Select the 1st Viz.
Select Layout →Border → 1st Border → Red. Do the same for the
remaining 3 Viz.

11. Click on Presentation Mode to get the full screen view of the
Dashboard. ESC to cancel.
12. To apply a filter (e.g. filter by Category) to all 4 Viz in the Dashboard,
you need to do this.
a. In Sheet 1 → Dimensions → drag Category to Filters → click on
OK → then right click on the Category in Filters → Apply to
Worksheets → All Using this Data Source.

b. Then go the Dashboard → select the 1st viz → click on Analysis


Menu → Filters → Category.
c. The Category Filter will appear on the right side of the Dashboard.

13. If you unselect any of the Category in the Filter, all the Viz in the
Dashboard will be updated automatically. Do take note that the
respective Sheets will also be updated. E.g. unselect Furniture and
Office Supplies.
The 4 Charts in the Dashboard will only show information related to
Technology.
14. Save your Dashboard. Select all Categories in the Category filter.
To save → File Menu → Save to Tableau Public As → EXERCISES-
CHAPTER 10.

15. You will now be in the Tableau Public Server and you can view your
Dashboard.
16. To download the Workbook to your local machine.
a. Click on the download icon → Download (found in the center of
the screen).

b. Download → Tableau Workbook → click on Download.


Take note of the location for the download file. File Name:
EXERCISES-CHAPTER 10.twbx
c. Once you have downloaded the Viz to your local machine, you can
give it to your colleagues and they can view the Dashboard using
Tableau Reader.

d. Download → PowerPoint → click on Download.


Take note of the location for the download file. File Name:
EXERCISES-CHAPTER 10.pptx
What did you learn from this Chapter?
1. How to build a Dashboard in Tableau?
2. How to save the Dashboard to your local machine?
3. How to export the Dashboard to Power Point?
Chapter 11
Introduction to Sets, Filters,
Parameters and LOD
Chapter 11 - Introduction to Sets, Filters, Parameters and LOD
The objective of this Chapter is to introduce Sets, Filters, Parameters
and LOD in Tableau. Once you understand how to use them in Tableau, you
should have the knowledge and skills sets to handle more complex scenarios.
What are Sets in Tableau?
Sets are custom fields that are created within Tableau Desktop based on
dimensions from the data source. They are subsets of the data, which can be
created manually or computed. For example, a set can be created for having a
subset data of top 10 customers with the highest sales.
What are Filters in Tableau?
Filters restricts the number of records present in data set based on given
conditions. Types of filters used in Tableau includes extract filters, data
source filters, context filters, dimension filters and measure filters.
What are Parameters in Tableau?
A Parameter is a global placeholder value such as a number, date, or string
that can replace a constant value in a calculation, filter, or reference line. For
example, Users may create a calculated field that returns True if Sales is
greater than $500,000 else return False.
What are LOD in Tableau?
Level of Detail expressions (also known as LOD expressions) allow Users to
compute values at the data source level and the visualization level. However,
LOD expressions give Users even more control on the level of granularity
they want to compute. They can be performed at a more granular level
(INCLUDE), a less granular level (EXCLUDE), or an entirely independent
level (FIXED).

1. We will build 1 Workbook and 4 Sheets for 4 Charts/ Exercises.


2. Launch Tableau.
3. File Menu → Open → Global Superstore.xls.
4. Drag Orders and People to the Canvas. You can also use double click.
Exercise 01 – How to build Sets to get Top “N” records. E.g.
Top 5 Sales by Sub-Category

Steps Required:
a. Use Sheet 1.
b. Dimensions → drag Sub-Category to Columns.
c. Measures → drag Sales to Rows and Labels in Marks.
d. Dimensions → right click on Sub-Category → Create → Set and select
Top

e. Name the Set: Top N → then select By field (Top) → drop down on 10
→ create a New
Parameter → you should see Sub-Category Parameter.

f. Use the same Values as my example below. Click on OK twice when


done.
Current value = 1 and Maximum Value = 10.
g. On the left below the Dimensions, you will see Top N. This is called
Sets.
Under Parameters, you will see Sub-Category Parameter.

h. Dimensions → right click on the Top N and click on Show Filter.


i. Parameters → right click on the Sub-Category Parameter and click on
Show Parameter.
The Set and Parameter will now appear to the right side of the screen. If
this is hidden from your view, click on Show Me.
j. Dimensions → drag Top N to Colour in Marks.
k. Analysis Menu → Legends → Colour Legend (In/Out of Top N).
You should now see the Legends on the right.

l. You can now move the Sub-Category Parameter slider left or right to
get the top number of records. You also have the option to click on
IN/OUT(Top N) to only show selected records or only deselected
records.
Exercise 02 – How to build Parameters and combine with
Filters. E.g. to view Profit or Sales by Category/ Country/
Person

Steps Required:
a. Use Sheet 2.
b. Dimensions → drag Person, Country and Category to Rows.
c. Dimensions → right click on Person, Country and Category (one at a
time) → Show Filter.

The 3 Dimensions selected will appear in Filters and on the right side of
the screen.

d. Create a Parameter. Click on the down arrow. We are going to build a


new Parameter to select Sales or Profit, so that you will be able to view
Sales or Profit in the Viz.
In the Name field, enter the name pSales or Profit and click on List and
enter the details below and click on OK.
Note:
The p will allow you to easily identify Parameters used to build the Viz.
Also, to distinguish when you use the same Field Name for other Fields
e.g. Calculated Fields.

e. Right click on the pSales or Profit Parameter and click on Show


Parameter to show Parameter Control on the right side of the screen.

f. Click on the arrowhead on pSales or Profit Parameter (on the right side
of the screen) and select Single Value List and you will see 2 radio
buttons → Sales or Profit.

g. We will now create a Calculated Field as follows. Use the drop-down


arrow.
Note:
The f will allow you to easily identify Formulas used to build the Viz.
Also, to distinguish when you use the same Field Name for other
Fields. E.g. for Parameters It is a good idea to drag the pSales or Profit
field from the Data Pane into the formula editor. Look for the red arrow
head to guide you on where to drop the field in the editor.
fSales or Profit
CASE [pSales or Profit] WHEN 1 Then [Sales] WHEN 2 Then [Profit]
END
You must see “The calculation is valid” before you click on OK.

Drop this Calculated → fSales or Profit Field in Columns.

h. View → we will now proceed to change the Sheet Title (Sheet 2).
Edit Title → Remove <Sheet Name>.
Then drop down on Insert → Select Parameters.pSales or Profit →
click OK.
i. View → to remove the text fSales or Profit → Right click → Edit
Axis on fSales or Profit.

j. Blank out the fSales or Profit from the Axis Titles → Title. Click on X
to exit.
k. Measure → drag fSales or Profit to Colour in Marks.

l. This is the final output.


You can now click on the Legends on the right → and select Category/
Country/ Person/ pSales or Profit to get the visualization from different
perspective.
m. E.g. Select Profit in pSales or Profit → select only Furniture in
Category → select all Countries → select only Chuck Magee in Person.
You get to see various combinations of Sales or Profit just by clicking
on the Category, Country and Person.

Exercise 03 – How to build a Fixed LOD to show Total Sales by


Category, Sales by Sub-Category and % Sales by Sub-Category
Steps Required:
a. Use Sheet 3.
b. Dimensions → drag Category and Sub-Category to Rows.
c. Measures → drag Sales to Text in Marks.

Create a Calculated Field → fTotal Sales by Category → enter this


Formula
{Fixed[Category]:sum([Sales])} → Click OK.
d. View → drop this Calculated Field on the Category Sales.
Below Marks → re-arrange to position SUM(fTotal Sales by Category)
then SUM(Sales) in the Measure Values.

e. View → we are now going change the title → right click on Sales →
Edit Alias → change to Sales by Sub-Category → click OK

Do the same for fTotal Sales by Category. Remove only the f from
Total

f. Create one more Calculated Field → f%Sales by Sub-Category and


enter this Formula sum([Sales])/sum ([fTotal Sales by Category]) and
drop it in Measure Values after SUM(Sales)
Remember you can drag the fields from the Data Pane into the formula
editor.

g. View → then change field title → f% Sales by Sub-Category to


% Sales by Sub-Category → right click → Edit Alias
(remove only the f).
h. Measure → format the AGG(f% Sales by Sub-Category) to 2
Values decimal Places → Right click → Format → Pane →
Numbers: Percentage → Decimal places: 2 → click outside
to take effect.

This is the final output. We can now view Sales and % Sales by Sub-
Category compared to Total Sales by Category.
Exercise 04 – How to build a Fixed LOD to chart the number of
Customer Orders by Region?

Steps Required:
a. Use Sheet 4.
b. Create 2 new Calculated Fields as follows:
Number of Records
COUNT([Orders])
and
fNumber of Customer Order by Region
{FIXED [Region]:COUNT([Order ID])}

c. Measures → right click on fNumber of Customer Order by Region


and Convert to Dimensions.

d. Dimensions → drag fNumber of Customer Order by Region to


Columns.
e. Measures → drag Number of Records to Rows.
f. Dimensions → drag fNumber of Customer Order by Region to Colour
in Marks.
g. Dimensions → drag Region to Label in Marks.
h. Columns → right click on fNumber of Customer Order by Region →
Format → Pane → Numbers → Custom → Format: →
enter #,##0 → click outside to exit.

i. This is the final output.

j. To save your Viz, click on → File Menu → Save to Tableau Public As


EXERCISES-CHAPTER 11.
What did you learn from this Chapter?
1. Learn how to build Sets.
2. Learn how to build Parameters.
3. Learn how to build Fixed LOD.
4. Learn, it is good idea to use the initial f and initial p to identify
formulas (calculated fields) and parameters in Dimensions and
Measures.
Chapter 12
Tableau with a Microsoft SQL
Accounting System
Chapter 12 - Tableau with a Microsoft SQL Accounting System
If you have installed Tableau Desktop, the program will be able to read many
Data Sources. Click on To a Server → More… → Look at the large number
of data sources available.

1. I received many requests asking me to include a chapter on Accounting


Software with Tableau. I am a Certified Software Consultant and I have
been working with an Accounting Software for more than 20 years. I
will use this Accounting Software to do the visualization.
2. You must have a working knowledge of the Software Applications,
Tables, Fields and Data Structure commonly referred to as Data
Dictionary. You must also know the Database Engine.
This is the Data Dictionary for this Accounting Software.
Tableau Desktop
1. You can use Tableau Desktop to read the Tables in the Accounting
Software directly via Microsoft SQL Server Data Source.

2. Click on Microsoft SQL Server and enter the relevant credentials and
Sign In You will then be able to view the Database IDs and Tables.
Note: Tableau can read similar Tables from multiple datasets or
multiple Tables within the same dataset.
3. Example if you want to plot AR and AP outstanding balances by
Source Currency There will be 2 Tables involved → APVEN and
ARCUS. You need to extract Currency and Amount Outstanding from
both tables.
a. Drag APVEN to the Canvas and click on Update Now.

b. Use Manage metadata to hide Fields which are not required for the
visualization.
Right click. Select individual fields or a range of fields to hide.
c. Click on Sheet 1 and then click on New Data Source.

d. Select Microsoft SQL Server and connect to the same Dataset


(SAMLTD) and drag ARCUS to the Canvas. Click on Manage
metadata and hide fields which are not required. Once done, click
on → Preview data source.

e. Now when you click on Sheet1. Users will now see 2 data sources.
APVEN(SAMLTD) and ARCUS(SAMLTD).

f. Click on Data Menu → Edit Blend Relationship → We can see


how the data sources are joined → click OK.

g. You can proceed to do your Viz.


Tableau Public
However, as I am using Tableau Public for this book, I will export the
Accounting data into Microsoft Excel. There are a number of ways to do this
(see diagram below). Then use Tableau to read the Excel File and do the
visualization.
Take note of the Date Format when the data is exported to Excel. It could be
→ YYYYMMDD (numeric). If this is true, use Excel Formulas to convert to
date to DD/MM/YYYY.

If you are using ODBC to connect to your Accounting System, the


connection could be set to “real time”. You could then refresh your Microsoft
Excel file and the Viz also gets refreshed.

Excel File/ Data Source


You can download this dataset from:
https://drive.google.com/file/d/1AygGA1GIUki6Atwo3cFyThoAJJp6IgmR/view
AR.xlsx and AP.xlsx
Identify a common key field between the 2 Tables. In this example:
Currency.

4. Launch Tableau Public.


File → Open → File Name: APVEN.
5. Click on Sheet 1 → Data Menu → New Data Source → Microsoft
Excel → File Name:

ARCUS.

6. You should now see 2 Data Sources in Sheet 1:


• Sheet1 (APVEN)
• Sheet1 (ARCUS)
7. Click on Data Menu → Edit Blend Relationship.
The 2 Tables are automatically joined by Tableau because there is a
common key field in both Tables.

8. We are going to learn how to build the Viz below.

Exercise 01 – Chart Source Currency outstanding balances in


Accounts Receivable (AR) and Accounts Payable (AP)
Steps required:
a. Click on APVEN in Sheet 1.
1. Dimensions → drag Currency to Columns.
2. Measures → drag APbalance to Rows.

You should now see this:

b. To exclude Currency CNY from our Viz:


Dimensions → drag CURRENCY to Filters and unselect CNY →
Click OK.

c. Click on ARCUS in Sheet 1.


Measure → drag Arbalance to Rows.

We should now get this:


d. Click on Show Me and select Side-by-Side Bars (Chart number 9).

e. Click on
APVEN.
f. Measures → drag Measure Values to Label in Marks.
g. Marks → click on Size to reduce to size of the Bars.
h. View → hide the text CURRENCY → select Currency → right
click → Hide Labels for Columns.

i. View → to remove the text Value → select Value → right click → Edit
Axis → blank Axis Titles.
j. View → right click on Apbalance → Rotate Label.

k. Rename Sheet 1 to AR and AP Outstanding by Source Currency.


l. Remember to save your Viz in the Tableau Public Server.
m. This is the final output.
Exercise 02 – Chart Sales by Salesman by Quarters for 2019 by
functional currency

You can download this dataset from:


Dataset:
https://drive.google.com/file/d/1AygGA1GIUki6Atwo3cFyThoAJJp6IgmR/view
Filename: OESHDT.xlsx
Steps Required:
To chart Sales by Salesman by Quarters for 2019:
a. Click on Sheet 2 → File → Open → OESHDT.
This file contains the sales history data exported from the Accounting
System into Excel
b. The Period is stored as a Number as opposed to Text in the Accounting
System. Convert Period from Measures to Dimensions.

c. In this Accounting System, Sales and Sales Returns are 2 separate


fields. (Famtsales and Fretsales). To get Net Sales, the formula is
[Famtsales]-[Fretsales] → Click OK.
d. Build a Formula for Net Sales.
Note:
You can drag the fields from the Tables into the formula editor/
calculation editor.

e. Dimensions → Drag Nameempl and Period to Columns.


f. Measures → drag Net Sales to Rows.

g. Dimensions → drag Nameempl to Colour in Marks.


h. Measures → Drag Net Sales to Label in Marks.

i. Dimensions → drag YR to Filters and select 2019 → click OK.

j. Dimensions → right click on Period → Create → Group.


k. Note: 3 Periods = 1 Quarter so all in there will be 4 Quarters (Q1, Q2,
Q3 and Q4).
1. To Group the Periods in Quarters, press and hold Ctrl key on
keyboard.
2. Select Period 1, 2 and 3 → release Ctrl key on keyboard →
click on Group.
3. Type in group name Q1 → Press Enter key on keyboard.
4. Do the same for Q2 (Period 4, 5, 6), Q3 (Period 7, 8, 9) and
Q4 (Period 10 and 12).
5. Lastly, click OK to complete Group (Period) creation.
l. Columns → drag out Period replace with Period (group). It has a
paper clip symbol.
m. Marks → select Line and set Fit in the Task Bar to
Entire View.
n. Rename Sheet 2 to Sales by Salesmen by Quarters for 2019.
o. Hide Show Me.
p. This is the final output.

q. Marks → select Bar and then move Nameempl to Row, you will
get this Chart.
Exercise 03 – Build the Dashboard

Steps Required:
To build the Dashboard.
a. Click on New Dashboard. Then double click on Sheet 1 and Sheet 2.
b. For size, unselect Maximum Size.

c. Right click to rotate Label for Apbalance and Arbalance.

d. To remove Net Sales → right click → uncheck Show Header.

e. This is the final output.


f. If you are using Tableau Desktop, you can click on Share Workbook
with Others.

Then click on Tableau Online or Create Site.

g. Sharing workbooks with people who do not have Tableau Desktop.


h. Question:
How to share workbooks with people who do not have Tableau
Desktop?
Environment:
Tableau Server
Tableau Reader
Tableau Public
Answer:
Workbooks can be shared with people who do not have Tableau
Desktop in the following ways:
Publish the workbook to Tableau Server. Tableau Server provides
browser-based analytics. After publishing the workbook to Tableau
Server, others with a Tableau Server account can sign in to see the
workbook. A trial version of Tableau Server can be downloaded from
the Tableau Server Product page.
Email the workbook and open it in Tableau Reader. Email a
workbook and its data source to others saved as a .twbx, and they can
open and see its contents using Tableau Reader. Tableau Reader is a
free application that can be used to open and see workbooks that have
been built in Tableau Desktop.
Save the workbook to Tableau Public. After publishing a workbook
to Tableau Public, anyone with a link to the workbook can see its
contents. Workbooks and the underlying data saved to Tableau Public
are accessible to the public.
Publish the workbook to Tableau Online. Tableau Online let Users to
view and share dashboards from the office, at home or on the road
using native mobile apps from the Web or a tablet. Only authorized
User can interact with data and dashboards. Use single sign-on to make
security easy for trusted User. A trial version of Tableau Online can be
requested from the Tableau Online Product page.
Exercise 04 – Other Areas (applicable if you have installed
Tableau Desktop)
a. Right click on the figures → View Data → then click on Full Data.
b. You can click on Export All → to export the data to a CSV format.
This is useful if Users need to validate the data extracted by Tableau.

c. To refresh the data in Tableau.


a. Select the Data Source and Double click on OESHDT+
(SAMLTD) .

b. Click on → Extract → Refresh → Update Now.

c. Click on any Sheet → Data Menu → Refresh all Extracts.


Exercise 05 – Dates in the Accounting System
a. You must check how Dates are stored in the Accounting System. The
Dates could be stored as Numbers as opposed to Date or String. E.g.
Jrnldate in this Accounting Software is stored a number 20,181,231 as
opposed to 31/12/2018.

b. Create a Calculated Field in Tableau to convert to Jrnldate to


DD/MM/YYYY:
DATE
MID(STR([Jrnldate]),7,2)
+"-"+MID(STR([Jrnldate]),5,2)
+"-"+MID(STR([Jrnldate]),1,4)
c. Dimensions → right click to covert Date to String.
What did you learn from this Chapter?
1. You learn there are significant differences between Tableau Desktop
and Tableau Public when doing analysis on an SQL Accounting
System.
2. You must know how the information is stored in the Accounting
System (Application/ Tables/ Fields).
3. How to create Groups?
4. How to build a Formula to convert dates which are stored as numbers?
Chapter 13
Plotting Malaysia 4D Lottery
Results
Chapter 13 - Plotting Malaysia 4D Lottery Results
This Chapter teaches you how to analyze Malaysia 4D Results for Magnum
4D, Sports ToTo 4D and DaMaCai 1+3D.
Malaysia 4D lottery numbers
1. 4-Digits (abbreviation: 4-D) is a lottery in Singapore and Malaysia.
Individuals play by choosing any number from 0000 to 9999. Then,
twenty-three winning numbers are drawn each time. If one of the
numbers matches the one that the player has bought, a prize is won. A
draw is conducted to select these winning numbers.
2. In Sep 2020, I did a training for a few people who wanted to know how
to use Tableau to plot and analyze the top 3 prices for Magnum, Sports
Toto and DaMaCai. I learned so much from this training and I would
like to share my experiences.
3. Are the results random or is there a set pattern? The objective of this
Chapter is to learn how to do various analysis using Tableau. You
could use this knowledge to plot production output by machine or by
shifts and perhaps staff attendance and even analyze overtime over a
given time frame.
4. We will use Tableau Public to plot the top 3 prices for Magnum, Sports
Toto and DaMaCai for September/ October/November 2020. You can
download this dataset from: Dataset:
https://drive.google.com/file/d/1AygGA1GIUki6Atwo3cFyThoAJJp6IgmR/view
Filename: 4D-SEP-OCT-NOV-2020.xlsx
5. As I mentioned earlier, interpretation is relative.
6. You can view the 4-digit results (current and historical) from
https://www.4dking.com.my/. As there is no option to export the data
into Excel, I had to use copy/ paste into Excel.
7. Fields Required for this exercise:
Date/ Day/ Lottery/ Prize /Result
Format the Result in Excel to 4 digits (as all lottery results must display
4 digits)→ right click on the Result Column → Format → Custom →
enter 0000 → click OK.

8. Launch Tableau and open the 4 digits Excel File (File Name: 4D-SEP-
OCT-NOV-2020.xlsx) containing results for Sep to Nov 2020 results.
9. Take note that Tableau will show the results with thousand separator
and remove all leading zeroes for results with 0’s in front. E.g. 0023.

10. This is what you should see in Sheet 1.


Exercise 01 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by
Lottery/ Date/ Result/ Prize
We will plot the Top 3 Prizes SEP/ OCT/ NOV 2020 - by Lottery/ Date/
Result/ Prize.
1. Dimensions → drag Prize to Columns.
2. Dimensions → drag Date and Lottery to Rows.
3. Measures → drag Result to Text in Marks.

4. Rows → right click on +YEAR(Date) → select Exact Date (the


date changes to green → field is Continuous).
→ right click on Date once more → select Discrete (the
date changes to blue).

5. To show the results as 4 digits and without the thousand separators.


Marks → right click on SUM(Result) → Format → Pane → Numbers
→ Custom → Format → enter 0000 → click outside to exit.

6. Edit Title:
SEP/ OCT/ NOV 2020
Top 3 Prizes
By Lottery/ Date/ Result/ Prize
7. This is the final output.
Exercise 02 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by
Date/ Lottery/ Result/ Prize
We will plot the Top 3 Prizes SEP/ OCT/ NOV 2020 - by Date/ Lottery/
Result/ Prize.
1. Make a duplicate of Sheet 1 → right click → Duplicate → you will get
Sheet 1 (2).

2. Rows → move Date in front of Lottery and the Viz will be sorted
by Date.
3. Edit Title:
SEP/ OCT/ NOV 2020
Top 3 Prizes
By Date/ Lottery/ Result/ Prize
4. This is the final output.

Exercise 03 – Plot the Top 3 Prizes SEP/OCT/NOV 2020 – by


Prize/ Date/ Lottery/ Result
We will plot the Top 3 Prizes SEP/OCT/NOV 2020 - by Prize/ Date/ Lottery/
Result.
1. Make a duplicate of Sheet 1 (2) → right click → Duplicate → you will
get Sheet 1 (3).

2. Columns → drag Prize from Columns to Rows and drop it before


Date.

3. Edit Title:
SEP/ OCT/ NOV 2020
Top 3 Prizes
By Prize/ Date/ Lottery/ Result
4. This is the final output.

Exercise 04 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by


Prize/ Lottery/ Date/ Result
We will plot the Top 3 Prizes SEP/ OCT/ NOV 2020 - by Prize/ Lottery/
Date/ Result.
1. Make a duplicate of Sheet 1 (3) → right click → Duplicate → you will
get Sheet 1 (4).

2. Rows → drag Lottery and drop it after Price.

3. Edit Title:
SEP/ OCT/ NOV 2020
Top 3 Prizes
By Prize/ Lottery/ Date/ Result
4. This is the final output.
Exercise 05 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by
Prize/ Date/ Lottery/ Result
We will plot the Top 3 Prizes SEP/ OCT/ NOV 2020 - by Prize/ Date/
Lottery/ Result.
1. Make a duplicate of Sheet 1 (4) → right click -→ Duplicate → you will
get Sheet 1 (5).

2. From Rows → drag Lottery to Columns.

3. Edit Title:
SEP/ OCT/ NOV 2020
Top 3 Prizes
By Prize/ Date/ Lottery/ Result.
4. Similar presentation to Sheet 1 (3) except now that Results are in
Columns. Makes it easier to view your analysis.
5. This is the final output.
Exercise 06 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by
Prize/ Lottery/ Result/ Date
We will plot the Top 3 Prizes SEP/ OCT/ NOV 2020 - by Prize/ Lottery/
Result/ Date.
1. Make a duplicate of Sheet 1 (5) → right click → Duplicate → you will
get Sheet 1 (6).

2. From Rows → move Date to Columns.


3. From Columns → move Lottery to Rows. Drop it after Prize.
4. Columns → right click on Date → Format → Format Date →
Header → Dates → Custom → Format: → enter DD/MM
→ click outside to exit.
6. Edit Title:
SEP/ OCT/ NOV 2020
Top 3 Prizes
By Prize/ Lottery/ Result/ Date
7. This is the final output.

Exercise 07 – Plot the Top 3 Prizes SEP/ OCT/ NOV 2020 – by


Result/ Prize/ Lottery with Filters for Lottery/ Prize/ Date
We will plot the Top 3 Prizes SEP/OCT/NOV 2020 - by Result/ Date/ Prize/
Lottery with filters for Lottery/ Prize/ Date.
1. Make a duplicate of Sheet 1 (2) → right click → Duplicate → you will
get Sheet 1 (7) → Move Sheet 1 (7) to the far right.
2. Columns → drag Price to Rows and drop it in-between Date and
Lottery.
3. Marks → right click on SUM(Result) and select Discrete.

4. Marks → drag SUM(Result) to Rows and drop it before Date.

5. Rows → right click on SUM(Result) → Format →


Header → Numbers → Custom → Format →
enter 0000 → click outside to exit.

6. Dimensions → drag DAY to Text in Marks to show the Day of the


Week (Mon to Sun).
7. Rows → right click on Date → Show Filter. Do the same for
same for Prize and Lottery.

8. The Filters you set will appear on the left under Filters and also on the
right for you to make your selection.
You can filter by Date, Prize and Lottery.

9. Click on the drop down in the Date Filter on the right and select
Multiple Values (dropdown).
Multiple Values(Dropdown): Displays the values of the filter in a
drop-down list where multiple values can be selected.
If you uncheck All, you can click on any Dates to see the Results.

10. Edit Title:


SEP/ OCT/ NOV 2020
Top 3 Prizes
By Result/ Date/ Prize/ Lottery
11. This is the final output.

Exercise 08 – Plot the Top 3 Prizes SEP 2020


We will plot the Top 3 Prizes SEP 2020.
1. Make a duplicate of Sheet 1 (7) → right click → Duplicate → you will
get Sheet 1 (8).
2. Clear current Filter for → Date/ Prize/ Lottery (one at a time). Right
click → Clear Filter.

3. Row → drag Lottery and Date to Columns.


4. Marks → drag out Day.
5. Rows → right click on SUM(Result) and select Continuous.

6. Rows → hold the control key and drag the SUM(Result) to Label
in Marks.

7. Dimensions → drag Date to Filter and select # Month / Year → Next →


select September 2020 → click OK.
8. Marks → select Size → set to minimum.

9. Columns → right click on Date → Format → Header → Dates →


Custom → Format: → enter DD → click outside to exit.
10. Columns → hold control key and drag Date to Colour in
Marks.
11. Drag Date Legends on the right → drop it below Marks to get more
space for the View.

12. View → right click on Result → uncheck Show


Header.
13. Rows → right click on SUM(Result) → Format →
Pane → Numbers → Custom → Format: →
enter 0000 to remove the commas from
SUM(Results).

12. Edit Title:


SEP 2020
Line Chart showing Top 3 Prizes
13. This is the final output.
Exercise 09 – Plot the number of records for each series from 0
to 9 for SEP/ OCT/ NOV 2020
We will plot the number of records for each number series from 0 to 9 for
SEP/ OCT/ NOV 2020.
1. Create a new Sheet and rename to Sheet 1 (9).
2. Need to build 2 calculated fields:
a. Number of Records
1

b. Series
if [Result] >=0000 and [Result] <= 0999 then 0
elseif [Result] >=1000 and [Result] <= 1999 then 1
elseif [Result] >=2000 and [Result] <= 2999 then 2
elseif [Result] >=3000 and [Result] <= 3999 then 3
elseif [Result] >=4000 and [Result] <= 4999 then 4 elseif
[Result] >=5000 and [Result] <= 5999 then 5
elseif [Result] >=6000 and [Result] <= 6999 then 6
elseif [Result] >=7000 and [Result] <= 7999 then 7
elseif [Result] >=8000 and [Result] <= 8999 then 8
elseif [Result] >=9000 and [Result] <= 9999 then 9
else 999999
END

3. Measures → right click on Series and Convert to Dimensions.


4. Dimensions → drag Series to Rows.
5. Dimensions → drag Date and Lottery to Columns.
6. Measure → drag Number of Records to Text in Marks.
7. Columns → right click on +YEAR(Date) and select Month
(Discrete) –> 1st Month.

8. Analytics → drag Totals to the View and select Subtotals.

9. Edit Title:
SEP/ OCT/ NOV 2020
Number of Records from 0 to 9 series
10. This is the final output.
Exercise 10 – Packed Bubbles to show the Results for Oct 2020
We will build a Packed Bubble to show the Results for Oct 2020.
1. Create a new Sheet and rename to Sheet 1 (10).
2. Dimensions → drag Date to Filters → select # Months → Next →
select October → click OK.

3. Measures → drag Result to Dimensions.


4. Dimensions → drag Lottery, Result and Date to Text in Marks (one at a
time).
5. Measures → drag Sheet1 (Count) to Size in Marks.
6. Dimensions → drag Lottery to Colour in Marks.
7. Marks → right click on +YEAR(Date) and select → Day (1st Day/
discrete).

8. Marks → right click on Results → Format → Pane → Numbers


→ Custom → Format: → enter 0000 → click outside to
exit.
9. Show Me → click on packed bubbles (chart number 24).

10. Marks → right click on Lottery (T/ Label) → Edit


Aliases → Value (Alias) → Enter DaMaCai =
D, Magnum = M and Toto = T → click OK.
Caution: The Lottery Field in all the previous Worksheets will also
be updated

11. When you hover your cursor over the coloured bubbles, you get to view
the Date, Lottery and Result.
12. Edit Title:
OCT 2020 - Packed Bubbles showing Day, Lottery and Result
13. This is the final output.
14. To see the labels within the bubble, press on F7 (Presentation Mode).
ESC to cancel.

Exercise 11 – When the Results were last drawn and what


Prizes it won
Let us do something different. The good thing about Tableau is that you can
leave the current Workbook open and start a new Workbook (File → New).
You want to type any Result and would like to know when it was last drawn
and what Prizes it won.
Download Toto results from 06/05/1992 to 31/10/2020 in txt format:
https://www.sportstoto.com.my/results_download.asp

1. New Workbook → File Open → select the file that you downloaded
(4D-TOTO).

2. Click on Manage metadata.

3. Highlight 1stPrizeNo until ConsolationNo10 → right click → Pivot.


What is Pivot:
To reshape your data for easier analysis in Tableau, you can perform a
pivot. In Tableau, pivoting means transposing data from a crosstab
format into a columnar format–from wide, short tables into thin, tall
tables.
4. Click on Sheet 1.
5. Dimensions → drag Draw Date to Rows.
6. Rows → right click on Draw Date → Exact Date → Discrete.
7. Dimensions → drag Pivot Field Names to Rows.
8. Measures → drag Pivot Field Values to Text in Marks.
9. Marks → right click on SUM(Pivot Field Values) → select
Discrete → then select Format → Pane → Numbers →
Custom → Format: enter 0000 → click outside to exit.

10. Dimensions → right click on Pivot Field Names → Show Filters


→ Pivot Field Names appear in Filters and on the
right side of the screen.
11. Measures → right click on Pivot Field Values → Default
Properties → Number Format → Custom → Format:
enter 0000 → click OK. Again → right click Pivot
Field Values → Convert to Discrete → right click
Pivot Field Values again → Show Filter.
12. On the right hand side of the screen, you should now see 2 filters →
SUM(Pivot Field Values) and Pivot Field Names.
13. Show Me → you may need to click on Show Me to see the
Filters on the right.
14. SUM(Pivot Field Values) on the right → click on the arrow down →
and then select Multiple Values (dropdown) → do the same for Pivot
Field Names on the right.

15. This is what you should see now.


16. SUM (Pivot Field Values) on the right → drop down → unselect All →
in Enter search text → type in 2305 and tick the check box. You will
now see the Results by Date and Prize.
Select All as you need to all Values for our Dashboard.

17. Dimensions → drop Pivot Field Names to Colour in Marks.


18. The Final Result.

19. What is interesting? Try this:


Type 25 or *25 or 25* in SUM (Pivot Field Value) on the right in Enter
search text. Look at what Result appears in search.
To select all Result at one go → use Shift, arrow down and Spacebar.

Exercise 12 – Number of times the Result was drawn over the


last few years
You now want to know the number of times the same Results that were
drawn over the last few years.
1. Click on New → you will get Sheet 2.
Sheet
2. Measures → select Pivot Field Values → Convert to Dimension.
3. Dimensions → drag Pivot Field Values to Rows. Add all members.

4. Dimensions → drag Pivot Field Values to Text in Marks.


5. Marks → right click on Pivot Field Values → select Measures →
Count.
6. Marks → right click on CNT(Pivot Field Values) → Show Filter.
7. Views → right click above the Count (no Field Title) → Sort
descending.

8. Use the Slider on the right → slide it and select the values you want to
see e.g. 10.

9. Show Me → select Horizontal Bars (no 7).

10.Dimensions → drag Pivot Field Values to Colour in Marks.


11.Measures → drag 4D-TOTO.txt(count) to Label in Marks.
12.Move CNT (Pivot Field Values) on the right to 28 (maximum).
13.The Final Result.

Exercise 13 – Build the Dashboard


We will now build the Dashboard using Sheets 1 and Sheet 2 to see things
from a different perspective.
1. Click on New Dashboard.
2. Select Floating and uncheck Maximum Size.

3. Sheet 1 → drag into the Dashboard and drop in the top left corner and
then drag it all the way to the bottom.
4. Select Pivot Field Name → (that display Prizes) click on X to Remove
from Dashboard.

5. Make the rectangle a bit leaner by dragging the right line in closer to
the Results.

6. Drag Sum of Pivot Field Values and then Pivot Field Names and
arrange next to the rectangle → Sum of Pivot Field Values above and
Pivot Field Names below.
7. Click on the Layout Tab.
Select the 1st rectangle → Border → then select the 1st line and the
green at the bottom.
Do the same for the other 2 rectangles. Using a common colour code is
probably a good option so you know all 3 rectangles are “related”.

8. Sheet 2 → drag into the Dashboard and drop in the top right corner and
then drag it all the way to the bottom. Just remember you are still using
Floating.
9. Select Pivot → click X to close Pivot Field Values.
Field Values
10.Select Count of Pivot Field → click X to close Count of Pivot Field
Values Values.
11. Sheet 2 → click on the down arrow head → select Filters → Pivot Field
Values.

12. Click on Pivot Field Values → click on the down arrow head (more
options) → select Multiple Values (dropdown).
13. Again click on Pivot Field Values → click on the down arrow head
(more options) → Apply to Worksheets → All Using this Data Source.

14. Select the 2nd rectangle → Layout → Border → then select the 1st line
and the red at the bottom.
Do the same for the other rectangle. Using a common colour code is
probably a good option so you know all 2 rectangles are “related”.
15. Do this and see what happens next.
16. Sheet 2 → Pivot Field Values → unselect All.
17. The key in 0019 in Enter search text and tick the check box for 0019.

18. You should see this now:


a. Sheet 2 → the number of times 0019 was drawn (Count) → 22
times.
b. Sheet 1 → you should see all the Draw Dates/ Prize / Result.

c. Sheet 1 → if you drop down on Pivot Field Names, you can


unselect All and select only the Prizes you want to view. E.g. 1st,
2nd and 3rd Prize.
Note:
When you save you Viz in the Tableau Public Server, remember to
click on Edit Details → Other Settings → tick Show workbook sheets
as tabs → click on Save.
Chapter 14
Tableau and the Stock Market
Chapter 14 - Tableau and the Stock Market
During my hands-on training sessions, many people wanted to learn how to
use Tableau to plot various charts for the Stock Market, especially the “well
known” Candle Stick Chart.
Caution
Want to invest in stock market? But unaware of the fluctuation of the current
share prices? Stocks are subject to market risk. Please analyze all market
trends carefully before investing.
Objective of this Chapter
1. This Chapter will only teach you how to plot historical share prices in
Bursa Malaysia (KLSE).
2. This Chapter will not teach how to do projections, forecast and guesses.
3. Whatever actions you take from this Chapter is at your own risks and
the author will not entertain any inquires pertaining to the stock market
or share prices.
4. This Chapter is purely informative and educational.
To build Stock Charts
1. To build Stock Chart, you will need 4 important measures to track the 4
points in the Chart → High, Open, Close and Low.
2. Definitions
High/Low → the maximum/ minimum prices in a given time frame/
period (e.g. hours, day, etc.).
Open/Close → prices at which a stock began and ended trading in the
same time frame/ period (useful for those involved in
measuring short term results).
3. Volume → will show the total amount of activity.
4. Date → is another important field. This is because Date will
show the time frames/ periods for formatting a Chart. You
could produce a Chart to show: Hourly/ Daily/ Monthly/
Quarterly/ Annually if your dataset has the information.
Datasets
1. I have included 2 datasets for this Chapter.
CIMB (bank) and KOSSAN (glove) shares from 19/Oct 2020 to 31/Dec
2020. There are actual share prices with dates and volume that I
extracted from Bursa Malaysia (KLSE). You can download this dataset
from:
Dataset:
https://drive.google.com/file/d/1AygGA1GIUki6Atwo3cFyThoAJJp6IgmR/view
Filename: CIMB.xlsx and KOSSAN.xlsx

2. Launch Tableau.
3. File Open → CIMB. This is the dataset for the CIMB Shares.

Exercise 01 – Build a Text Table to show Open/ Close/ High/


Low
Build a Text Table to show Open/ Close/ High/ Low.
1. Click on Sheet 1.
2. Dimensions → drag Date to Columns and Measure Names to Rows.

3. Measures → drag Measures Value to Text in Marks. Then drag out


CNT(Sheet1) and SUM(Vol) and then arrange the Measure
Values as follows: Open/ Close/ High/ Low (lookout for
the red arrow).

4. Columns → right click on +YEAR(Date) → select Exact Date →


followed by Discrete.
5. Columns → right click on Date → Format → Header → Dates →
Custom → Format: enter DD/MMM. Click outside to exit.

6. Edit the Title:


Table - Open/ Close/ High/ Low
Daily CIMB Share Prices in Bursa Malaysia
Start 19/Oct
7. This is the final output.
8. Do this and see what happens to your Viz:
a. Rows → move Measure Names to Columns.
b.Columns → move Date to Rows.
c. This is what you should see now.

9. Un-do all the actions for No. 8 before proceeding to next exercise.
Exercise 02 – Build a Line Chart to show Open/ Close/ High/
Low
Build a Line Chart to show Open/ Close vs High/ Low.
1. Make a duplicate of Sheet 1 → you will get Sheet 1 (2).

2. Select Sheet 1 (2) → Show Me → click on Line Chart (Chart number


13).

3. Columns → right click on +YEAR(Date) → select Exact Date →


followed by Discrete.

4. Rows → right click on SUM(Open) → select Dual Axis. Do the


same for SUM (High).

5. View → this is how the View would look like after the Dual
Axis.
6. You need to do this now:
a. View → right click on Close → Edit Axis → uncheck
Include zero → click X to exit.
Do the same for High, Open and Low.

b. View → right click on Close → Synchronize Axis. Do the


same for Low.
c. View → right click on Close → Edit Axis → Tick Marks →
Major Tick Marks → Fixed → change Tick Interval
from 1 to 0.1 → click X to exit.
Do the same for High, Open and Low.

d. Marks → select All.


e. Dimensions → drag Measure Names to Label in Marks.
f. Click on → Markers → All.
Color
g. Click on → Alignment → drop down → Direction → Normal
Label → Vertical → Middle.

h. Drag Measure Name on the right and drop it below Marks to give
more space to the View.

i. Tool Bar → Fit → drop down on Standard → select Entire


View.
j. Edit Title:
Line Chart - Open/ Close/ High/ Low
Daily CIMB Share Prices in Bursa Malaysia
Start 19/Oct
7. This is the final output.

8. Do this and see what happens to your Viz:


a. View → merge Close and Low.
→ merge High and Value.
b. To do this merging, drag Close and drop on Low. Then drag High
and drop on Value.
c. This is what you should get now.

d. View → right click on Value → Edit Axis → uncheck


Include Zero and remove Value from Axis Titles.
e. View → right click on Open → Edit Axis → remove Open
from Axis Titles.
f. This is what you should see now.

Exercise 03 – Build a Candle Stick Chart


1. Build a Candlestick Chart.
a. Stock Charts are also known as Candlestick Chart.
b. It is used to display stock prices plotted over any time frame/
periods you define.
c. Candlestick charts are used by traders to determine possible price
movement based on past patterns.
d. This Chart is frequently used by stock brokers and market
investors to identity Current Trends, Trends Reversal and to
Trigger Buy and Sell signals.
e. Candlesticks are useful when trading as they show four price
points (open, close, high, and low) throughout the period of time
the trader specifies (e.g. hourly/ daily/ weekly/ monthly).
f. Do a search on Candlestick in YouTube. There is so much you can
learn.

2. Create a New Sheet (Rename to Sheet 2).


Measures → drag Date to Columns.

Right click on Date → select Exact Date → Discrete.


3. Columns → right click on the Date → Format → Format Date →
Header → Dates → Custom → Format: enter DD/MMM
→ click outside to exit.

4. Dimensions → drag Date to Filters → select Range of Dates → click on


Next → 19/10/2020 to 30/11/2020 (you can change the
range of dates anytime) → click on OK.
5. Filters →right click on Dates → Show Filter.
The Filter will now appear on the right side of the screen below Show
Me.
You can then select a range of Dates by sliding the Filter to the right or
left.

6. Measures → drag High and Open to Rows.

7. Rows → right click on SUM(Open) → select Dual Axis.


Dual Axis allows to compare multiple measures on a different scale.
8. View → right click on Open → Synchronize Axis.

9. View → to remove the blank spaces → right click on High →


Edit Axis → uncheck Include Zero → click X to exit. This
will adjust the Axis according to the figures in the Data Set.

10.Marks → select All → drop down on Automatic → select Gantt


Bar → then drag out (remove) Measure Names.

11. We now need to create 2 calculated fields.


a. High Low → formula name.
Sum (Low) - → you can type this in the editor.
Sum (High)
This will show the fluctuation of the stock value from high to low.
Make sure you see → The calculation is valid before you click on OK.

Note:
If you drag Low and High field from the Measures into the Editor or
you select the field from the Editor, the Low and High field will be in
square brackets [ ].
It does not make any difference to the formula.
b. Open Close → formula name.
Sum (Close) - → you can type this in the editor.
Sum (Open)
This will show the rise and fall in stock price for the time frame
in question.

Make sure you see → The calculation is valid before you click
on OK.
12.Marks → select SUM(High) → Colour → Dark Grey.

13.Marks → select SUM (High).


14.Measures → drag High Low to Size in Marks → reduce the size to
the smallest.
This will make the Gantt Bar look like a vertical line.

15.Marks → select SUM(Open).


Measures → drag Open Close to Colour and Size in Marks.
16.Marks → select SUM(Open).
17.Marks → click on Colour → Edit Colours → drop down on
Palette: → select → Red Green Diverging → For Stepped
Colour → select 2 Steps → click on Advanced → select
Center → 0 → click OK.
When the stock close higher than open, the bar will appear as green and
when the stock closes at a lower price, the bar will appear as red.

18. Additional Formatting to make your Chart stand-out.


a. Tool Bar → Fit → select Entire View.
b. Marks → click on SUM(Open) → option to reduce or
increase the size of the bar.

c. View → right click on Open → uncheck Show Header.

d. View → right click on High → Edit Axis → remove High


from the Axis Titles → click X to exit.
e. View → Edit Axis → click on Tick Marks → Major Tick
Marks → Fixed → Tick interval → change to 0.03 →
click X to close.

f. Measures → drag Close and then Low to detail in Marks so that


when you hover the cursor over the Bars, you can see
the measure values.
19. Edit Title:
Candle Stick Chart
Daily CIMB Shares Prices in Bursa Malaysia
Start 19/Oct
20. This is the final output.

This Chart was given to me by the Investment Consultant. Generated by his


stock trading software. Just imagine, you can now generate Candlestick Chart
on your own using Tableau.
Exercise 04 – Build a Candle Stick Chart with Daily Volume
Build a Candlestick Chart with Daily Volume.
1. Make a duplicate of Sheet 2 (Candle Stick) → you will get Sheet 2 (2).
2. Measures → drag Vol to Columns.
3. Columns → right click on SUM(Vol) → select Discrete.

4. Columns → right click on SUM(Vol) → select Format → Format


SUM(Vol) → Header → Numbers → Number (Custom) →
Decimal Places: 0 → Display Units: drop down and select
Thousand (K).
5. From the right side of the screen → move Date and AGG (Open Close)
to below Marks so that you get a full view of your Chart.

6. View → right click on Date (DD/MMM) → select Rotate Label.


7. Edit Title:
Candle Stick Chart with Volume
Daily CIMB Shares Prices in Bursa Malaysia
Start 19/Oct
8. This is the final output.

Exercise 05 – Build a Line and Bar Chart to show Closing


Prices and Volume
Build a Line and Bar Chart to show Closing Prices and Volume.
1. Click on New Worksheet (Rename to Sheet 3).
2. Dimensions → drag Date to Columns (format → Exact Date/ Discrete).
3. Measures → drag Close then Vol to Rows.
4. Marks → click on SUM (Close) and select Line and then click on
SUM(Vol) and select Bar.
5. You should see this now.

6. Marks → select SUM(Close). → drag Close to Color and Label in


Measures Marks.
7. Marks → select SUM(Vol). → drag Vol to Color and Label in
Measures Marks.
8. Rows → right click on SUM(Close) → Format → Format
SUM(Close) → Pane → Numbers → Number (Custom) →
Decimal Places: 2.
9. Marks → select SUM(Close) → Colour → Edit Colour → Palette
→ Red-Green-Gold Diverging. Stepped Color → enter 2
→ click OK.

10. Marks → select SUM(Vol) → Color → Edit Colour


→ Palette → Orange-Blue-Diverging → click
OK.
11.Rows → right click on SUM(Vol) → Format → Format
SUM(Vol) → Pane → Numbers: → Number (Custom) →
Decimal Places:0 → Display Units: Thousands(K) → click
outside to exit.
12.Marks → select SUM(Close) → Label → click on Alignment:
Custom → Direction → Down.

13. Edit Title:


Line and Bar Chart - Closing Prices/ Volume
Daily KOSSAN Shares Prices and Volume in Bursa Malaysia
Start 19/Oct
14. Hide Card for SUM(Close) and SUM(Vol).
15. This is the final output.

Exercise 06 – Build a Line to show Open and Close Prices


Build a Line Chart to show difference between Open and Close Prices.
1. New Sheet (Rename to Sheet 4).
2. Dimensions → drag Date to Columns → right click → Exact Date →
Discrete.
3. Measures → drag Open Close to Rows.
4. Measures → drag Open Close to Colors and Labels in Marks.
5. Rows → right click on AGG(Open Close) and format to 2 decimal places
→ Negatives values in bracket [use Number(Custom)].
6. Columns → right click on Date and format to DD/MMM (use Custom).
7. Toolbar → change Standard to Entire View.
8. Edit Title:
Line Chart - Difference between Open/ Close prices
Daily CIMB Share Prices in Bursa Malaysia
Start 19/Oct
9. This is the final output.

Exercise 07 – Build an Area Chart to show Closing Prices


Build an Area Chart to show Closing Prices.
1. New Sheet (Rename to Sheet 5).
2. Dimensions → drag Date to Columns → right click → Exact Date →
Discrete.
3. Measures → drag Close to Rows.
4. Marks → drop down on Automatic and select Area.
5. Measures → drag Close to Colour in Marks.
6. Columns → right click on Date and format to DD/MMM (use
Custom).
7. Views → right click on Close → Edit Axis → Tick Marks →
Major Tick Marks → Fixed → Tick Interval → 0.1.

8. Marks → Colour → select Red → Opacity → 100%.


9. Edit Title:
Area Chart - Closing Prices
Daily CIMB Share Prices and Volume in Bursa Malaysia
Start 19/Oct
10. This is the final output.

Exercise 08 – Build a Line and Bar Chart combined to show


Volume and Open Close Prices
Build a Line and Bar Chart Combined – Volume and Open Close prices.
1. New Sheet (Rename to Sheet 6).
2. Dimensions → drag Date to Columns → right click → Exact Date →
Discrete.
3. Measures → drag Vol and then Open Close to Rows.
4. Rows → right click on AGG(Open Close) → select Dual Axis.
5. Marks → select SUM(Vol) → drop down on Automatic → select
Bar.
6. Marks → select AGG(Open Close).
7. Measures → drag Open Close to Label in Marks.
8. Columns → right click on Date and format to DD/MMM (use
Custom).
9. Rows → right click on AGG(Open Close) and format to 2
decimal places → Pane → Number (Custom) → Negatives
values in bracket.
10. Edit Title:
Line and Bar Combined - Volume and Open Close Prices
Daily CIMB Shares Prices in Bursa Malaysia
Start 19/Oct
11. This is the final output.

Exercise 09 – How to filter the Gains or Losses in Candle Stick


over a time frame/ period
Make a duplicate of Sheet 2 → you will get Sheet 2 (3) → drag it right to the
back. After Sheet 6.
How to filter the Gains or Losses in Candlestick Chart over a time frame/
period?
1. Create a Calculated Field as
follows:
Direction → Name of Field.
If ([Open Close]) > 0 then
"Up" else "Down"
END → Enter in Formula Editor.
Make sure you see The Calculation is Valid before you click on OK.

2. Measures → right click on Direction → show Filter.

3. The Filter appears on the right side of the Screen. Select Down or Up to
see the Gains/ Losses for the time frame/ period.
4. Candlestick Chart showing losses for the time frame/ period.

Short Note on Reference Line:


1. Remove the AGG(Direction) from Filter.
2. Click on Analytics.
3. Custom → drag Reference Line → to the Views → select Table.

4. Select Minimum, Maximum and Average (need to do this one at a


time).
5. This is the final output.

Exercise 10 – How to replace the current Dataset with a new


Dataset (same number of columns)
How to replace the current Dataset with a new Dataset (same number of
columns)?
1. We will replace CIMB with KOSSAN and all the Charts/ Viz will be
updated automatically.
2. You will be required to edit the Title later. Replace CIMB with
KOSSAN.
3. Save your current Workbook to the Tableau Public Server.

4. KOSSAN Share in KLSE.

5. Click on Sheet 1 → Data Menu → New Data Source.

6. Select Microsoft Excel → double click on KOSSAN.


7. Sheet 1 → right click on KOSSAN → Replace Data Source → Replace
Current: Sheet1 (CIMB). Replacement Sheet1 (KOSSAN) → click on
OK.
You are replacing CIMB with KOSSAN.

8. Sheet 1 → right click on CIMB → Close to remove CIMB.


9. These are KOSSAN Shares.
Remember to Edit the Title → replace CIMB with KOSSAN.

Exercise 11 – How to refresh after adding new records to the


same Dataset
1. Sheet 1 → select the Data Set → right click → Refresh.
2. If you have a Date Filter, check to make sure the new Dates are
included.
Exercise 12 – You have the option to Copy and Paste the
Dataset directly into the Worksheet
1. Open the Excel file CIMB.xlsx → highlight all the cells (Cells
A1..F53) or use Ctrl A to select all and Ctrl C to copy.
2. Launch Tableau. Click on this ICON to go directly to Sheet 1.

3. View → use Ctrl V to Paste (wait a short while).


4. Tableau does it best to build the visualization.
5. If you see the word “Clipboard” under Data, it means the User copy
and paste the Dataset in the Worksheet.
Glossary
Big Data
Big data is a term that describes the large volume of data – both structured
and unstructured – that inundates a business on a day-to-day basis. It’s what
organizations do with the data that matters. Big data can be analyzed for
insights that lead to better decisions and strategic business moves.
Business Intelligence
The term Business Intelligence (BI) refers to technologies, applications and
practices for the collection, integration, analysis, and presentation of business
information. The purpose of Business Intelligence is to support better
business decision making.
Data Analytics
Data analytics is the science of analyzing raw data in order to make
conclusions about that information. Many of the techniques and processes of
data analytics have been automated into mechanical processes and algorithms
that work over raw data for human consumption.
Data Visualization
Data visualization is the graphic representation of data. It involves producing
images that communicate relationships among the represented data to viewers
of the images. This communication is achieved through the use of a
systematic mapping between graphic marks and data values in the creation of
the visualization.
R
R is a programming language and free software environment for statistical
computing and graphics supported by the R Foundation for Statistical
Computing. The R language is widely used among statisticians and data
miners for developing statistical software and data analysis.
Python
Python is an interpreted, high-level, general-purpose programming language.
Created by Guido van Rossum and first released in 1991, Python's design
philosophy emphasizes code readability with its notable use of significant
whitespace. Its language constructs and object-oriented approach aim to help
programmers write clear, logical code for small and large-scale projects.
Data Scientist
Data scientists are analytical experts who utilize their skills in both
technology and social science to find trends and manage data. They use
industry knowledge, contextual understanding, and skepticism of existing
assumptions – to uncover solutions to business challenges.
SQL
SQL stands for Structured Query Language. SQL is used to communicate
with a database. According to ANSI (American National Standards Institute),
it is the standard language for relational database management systems.
Artificial Intelligence
Artificial intelligence (AI) refers to the simulation of human intelligence in
machines that are programmed to think like humans and mimic their actions.
The term may also be applied to any machine that exhibits traits associated
with a human mind such as learning and problem-solving.
Machine Learning
Machine learning is an application of artificial intelligence (AI) that provides
systems the ability to automatically learn and improve from experience
without being explicitly programmed. Machine learning focuses on the
development of computer programs that can access data and use it learn for
themselves.
PIG Programming Language
Pig is a high-level scripting language that is used with Apache Hadoop. Pig
enables data workers to write complex data transformations without knowing
Java. Pig's simple SQL-like scripting language is called Pig Latin, and
appeals to developers already familiar with scripting languages and SQL.
Apache Hadoop
Apache Hadoop is a collection of open-source software utilities that facilitate
using a network of many computers to solve problems involving massive
amounts of data and computation. It provides a software framework for
distributed storage and processing of big data using the MapReduce
programming model.
IOT
The internet of things, or IoT, is a system of interrelated computing devices,
mechanical and digital machines, objects, animals or people that are provided
with unique identifiers (UIDs) and the ability to transfer data over a network
without requiring human-to-human or human-to-computer interaction.
Predictive Modeling
Predictive modeling is a process that uses data and statistics to predict
outcomes with data models. These models can be used to predict anything
from sports outcomes and TV ratings to technological advances and
corporate earnings. Predictive modeling is also often referred to as: Predictive
analytics.
Digital Services
The term Digital Services refers to the electronic delivery of information
including data and content across multiple platforms and devices like web or
mobile.
IR 4.0
The Fourth Industrial Revolution (4IR) is expected to change how we live,
work, and communicate; it is also likely to change the things we value and
the way we value them in the future. Presently, we can already see changing
business models and employment trends. According to The World Economic
Forum, an estimated 65% of kids enrolling in primary education today will
end up working in jobs that haven’t been created yet. Automation and
artificial intelligence are change agents in 4IR that will make certain groups
of employees redundant, replacing them with new workers with the needed
skills or with machines that do the job cheaper. Gone are the days where
students go to college or university to study for a degree that will set them up
with a job for life.
Computer Science
Computer Science is the study of computers and computational systems.
Although knowing how to program is essential to the study of computer
science, it is only one element of the field. Computer scientists design and
analyze algorithms to solve programs and study the performance of computer
hardware and software.
Rapid Miner
Cloud-based data science platform for analytics professionals that helps unify
the entire data science lifecycle.
Apache Superset
Apache Superset is an open-source software application for data exploration
and data visualization able to handle large amounts of data (big data). The
application was developed by Airbnb and entered the Apache Incubator in
2017.
Microsoft BI
Power BI is a business analytics service by Microsoft. It aims to provide
interactive visualizations and business intelligence capabilities with an
interface simple enough for end users to create their own reports and
dashboards.
Free Public Data Sets
1. https://www.springboard.com/blog/free-public-data-sets-data-science-
project/
2. https://data.medicare.gov/data/hospital-compare#
3. https://wiki.dbpedia.org/develop/datasets
4. https://github.com/fivethirtyeight/data
5. https://www.tableau.com/learn/articles/free-public-data-sets
6. http://www.data.gov.my/data/ms_MY/dataset
7. https://www.kaggle.com/datasets

You might also like