Professional Documents
Culture Documents
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.
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.
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.
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.
6. Click on “Create one now for free” and enter the required information
to Create a
Profile.
Menu
File Menu
Data Menu
Help Menu
Connect
You must select the connector (how to connect to the data that you want to
use).
3. Chart Types
4. More how-to-videos
5. Current Status
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
Undo Redo
Sheets
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.
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
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.
• 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.
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.
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.
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.
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).
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.
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.
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.
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.
4. Click on Swap Rows and Columns button in Tool Bar to swap from
horizontal bar to vertical bar.
Drop in Column
Drop in Row
Same output as Exercise 05.
Drop in Body
Same output as Exercise 01.
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.
6. Select the Analytics Pane → double click on Totals. You will get Row
and Column Total.
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)
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.
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.
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:
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.
Steps Required:
1. Click on New Worksheet to get Sheet 2.
2. Dimensions → drag Country to Rows and Ship Mode to Columns.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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).
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.
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.
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).
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.
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.
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.
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.
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
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])}
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.
e. Now when you click on Sheet1. Users will now see 2 data sources.
APVEN(SAMLTD) and ARCUS(SAMLTD).
ARCUS.
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.
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.
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.
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.
3. Edit Title:
SEP/ OCT/ NOV 2020
Top 3 Prizes
By Prize/ Date/ Lottery/ Result
4. This is the final output.
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).
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).
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.
6. Rows → hold the control key and drag the SUM(Result) to Label
in Marks.
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
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.
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.
1. New Workbook → File Open → select the file that you downloaded
(4D-TOTO).
8. Use the Slider on the right → slide it and select the values you want to
see e.g. 10.
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.
2. Launch Tableau.
3. File Open → CIMB. This is the dataset for the CIMB Shares.
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).
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.
h. Drag Measure Name on the right and drop it below Marks to give
more space to the View.
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.
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.