100% found this document useful (2 votes)
1K views101 pages

Tableau Desktop Professional Book

Uploaded by

sachin rawat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
1K views101 pages

Tableau Desktop Professional Book

Uploaded by

sachin rawat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 101

EDUTECHAZA

INSTITUTION
Tableau

About the Tutorial


Tableau is a Business Intelligence tool for visually analyzing the data. Users can create
and distribute an interactive and shareable dashboard, which depict the trends, variations,
and density of the data in the form of graphs and charts.

Tableau can connect to files, relational and Big Data sources to acquire and process data.
The software allows data blending and real-time collaboration, which makes it very unique.
It is used by businesses, academic researchers, and many government organizations for
visual data analysis. It is also positioned as a leader Business Intelligence and Analytics
Platform in Gartner Magic Quadrant.

Audience
This tutorial is designed for all those readers who want to create, read, write, and modify
Business Intelligence Reports using Tableau. In addition, it will also be quite useful for
those readers who would like to become a Data Analyst or a Data Scientist.

Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of Computer
Programming terminologies and Data analysis. You should also have some knowledge on
various types of graphs and charts. Familiarity with SQL will be an added advantage.

Disclaimer & Copyright


 Copyright 2016 by Tutorials Point (I) Pvt. Ltd.

All the content and graphics published in this e-book are the property of Tutorials Point (I)
Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish
any contents or a part of contents of this e-book in any manner without written consent
of the publisher.

We strive to update the contents of our website and tutorials as timely and as precisely as
possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.
Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our
website or its contents including this tutorial. If you discover any errors on our website or
in this tutorial, please notify us at [email protected].

1
Tableau

Table of Contents
About the Tutorial ...................................................................................................................................... i
Audience .................................................................................................................................................... i
Prerequisites .............................................................................................................................................. i
Disclaimer & Copyright ............................................................................................................................... i
Table of Contents ...................................................................................................................................... ii

TABLEAU ─ BASICS ................................................................................................................. 1

1. Tableau ─ Overview .................................................................................................................................. 2


Tableau Features ....................................................................................................................................... 2

2. Tableau ─ Environment Setup ................................................................................................................... 3

3. Tableau ─ Get Started ............................................................................................................................... 7


Connect to a Data Source........................................................................................................................... 7

4. Tableau ─ Navigation .............................................................................................................................. 10


Menu Commands .................................................................................................................................... 10
File Menu ................................................................................................................................................ 11
Data Menu .............................................................................................................................................. 12
Worksheet Menu..................................................................................................................................... 13
Dashboard Menu ..................................................................................................................................... 13
Story Menu.............................................................................................................................................. 14
Analysis Menu ......................................................................................................................................... 15
Map Menu .............................................................................................................................................. 16
Format Menu .......................................................................................................................................... 17
Server Menu............................................................................................................................................ 18

5. Tableau ─ Design Flow ............................................................................................................................ 20

6. Tableau ─ File Types ................................................................................................................................ 22

7. Tableau ─ Data Types .............................................................................................................................. 24

8. Tableau ─ Show Me................................................................................................................................. 25


Show Me with Two Fields......................................................................................................................... 26
Show Me with Multiple Fields .................................................................................................................. 27

9. Tableau ─ Data Terminology ................................................................................................................... 28

TABLEAU ─ DATA SOURCES .................................................................................................. 30

10. Tableau ─ Data Sources ........................................................................................................................... 31

11. Tableau ─ Custom Data View .................................................................................................................. 33


Drill Down View ....................................................................................................................................... 33
Swapping Dimensions .............................................................................................................................. 34

6
Tableau
12. Tableau ─ Extracting Data ....................................................................................................................... 36
Creating an Extract .................................................................................................................................. 36
Applying Extract Filters ............................................................................................................................ 37
Adding New Data to Extract ..................................................................................................................... 38
Extract History......................................................................................................................................... 39

13. Tableau ─ Fields Operations.................................................................................................................... 40


Adding Fields to Worksheet ..................................................................................................................... 40
Combining Two Fields.............................................................................................................................. 41
Searching Fields....................................................................................................................................... 41
Reordering Fields .................................................................................................................................... 42

14. Tableau ─ Editing Metadata .................................................................................................................... 44


Checking the Metadata ........................................................................................................................... 44
Changing the Data Type........................................................................................................................... 45
Renaming and Hiding .............................................................................................................................. 46
Column Alias ........................................................................................................................................... 47

15. Tableau ─ Data Joining ............................................................................................................................ 48


Creating a Join ......................................................................................................................................... 48
Editing a Join Type ................................................................................................................................... 49
Editing Join Fields .................................................................................................................................... 50

16. Tableau ─ Data Blending ......................................................................................................................... 51


Preparing Data for Blending..................................................................................................................... 51
Adding Secondary Data Source ................................................................................................................ 52
Blending the Data .................................................................................................................................... 53

TABLEAU - WORKSHEETS ...................................................................................................... 54

17. Tableau ─ Add Worksheets ..................................................................................................................... 55

18. Tableau ─ Rename Worksheet ................................................................................................................ 57


Renaming the Worksheet ........................................................................................................................ 57

19. Tableau ─ Save & Delete Worksheet ....................................................................................................... 59

20. Tableau ─ Reorder Worksheet ................................................................................................................ 61

21. Tableau ─ Paged Workbook .................................................................................................................... 63

TABLEAU ─ CALCULATIONS ................................................................................................... 66

22. Tableau ─ Operators ............................................................................................................................... 67


Types of Operator ................................................................................................................................... 67

23. Tableau ─ Functions ................................................................................................................................ 71

24. Tableau ─ Numeric Calculations.............................................................................................................. 74

25. Tableau ─ String Calculations .................................................................................................................. 80

6
Tableau
26. Tableau ─ Date Calculations.................................................................................................................... 83

27. Tableau ─ Table Calculations .................................................................................................................. 86

28. Tableau ─ LOD Expressions ..................................................................................................................... 87

TABLEAU ─ SORT & FILTERS ................................................................................................... 92

29. Tableau ─ Basic Sorting ........................................................................................................................... 93


Computed Sorting ................................................................................................................................... 93
Manual Sorting........................................................................................................................................ 93

30. Tableau ─ Basic Filters............................................................................................................................. 94


Filter Dimensions..................................................................................................................................... 94
Filter Measures ....................................................................................................................................... 96
Filter Dates.............................................................................................................................................. 99

31. Tableau ─ Quick Filters ......................................................................................................................... 103


Clearing the Filter .................................................................................................................................. 105

32. Tableau ─ Context Filters ...................................................................................................................... 107


Creating Context Filter........................................................................................................................... 107

33. Tableau ─ Condition Filters ................................................................................................................... 112


Creating a Condition Filter ..................................................................................................................... 112

34. Tableau ─ Top Filters............................................................................................................................. 115


Creating a Top Filter .............................................................................................................................. 115

35. Tableau ─ Filter Operations................................................................................................................... 118


Creating Filters ...................................................................................................................................... 118
Clearing Filters....................................................................................................................................... 121

TABLEAU – CHARTS ............................................................................................................122

36. Tableau ─ Bar Chart .............................................................................................................................. 123


Simple Bar Chart.................................................................................................................................... 123
Bar Chart with Color Range.................................................................................................................... 124
Stacked Bar Chart .................................................................................................................................. 125

37. Tableau ─ Line Chart ............................................................................................................................. 126


Simple Line Chart .................................................................................................................................. 126
Multiple Measure Line Chart ................................................................................................................. 127
Line Chart with Label ............................................................................................................................. 128

38. Tableau ─ Pie Chart............................................................................................................................... 129


Simple Pie Chart .................................................................................................................................... 129
Drill-Down Pie Chart .............................................................................................................................. 130

39. Tableau ─ Crosstab ............................................................................................................................... 132

6
Tableau
Simple Crosstab..................................................................................................................................... 132
Crosstab - Color Encoded....................................................................................................................... 133
Crosstab with Row Percentage .............................................................................................................. 133

40. Tableau ─ Scatter Plot ........................................................................................................................... 136


Simple Scatter Plot ................................................................................................................................ 136
Scatter Plot - Color Encoded .................................................................................................................. 137
Drill-Down Scatter Plot .......................................................................................................................... 138

41. Tableau - Bubble Chart ......................................................................................................................... 140


Simple Bubble Chart .............................................................................................................................. 140
Bubble Chart with Measure Values ........................................................................................................ 141
Bubble Chart with Measure Colors......................................................................................................... 141

42. Tableau ─ Bullet Graph ......................................................................................................................... 143


Creating Bubble Chart ........................................................................................................................... 143

43. Tableau ─ Box Plot ................................................................................................................................ 145


Creating a Box Plot ................................................................................................................................ 145

44. Tableau ─ Tree Map .............................................................................................................................. 147


Creating a Tree Map .............................................................................................................................. 147

45. Tableau ─ Bump Chart .......................................................................................................................... 149


Creating a Bump Chart .......................................................................................................................... 149

46. Tableau ─ Gantt Chart........................................................................................................................... 153


Creating a Gantt Chart ........................................................................................................................... 153

47. Tableau ─ Histogram............................................................................................................................. 157


Creating a Histogram ............................................................................................................................. 157

48. Tableau ─ Motion Charts ...................................................................................................................... 159


Creating a Motion Chart ........................................................................................................................ 159

49. Tableau - Waterfall Charts .................................................................................................................... 162


Creating a Waterfall Chart ..................................................................................................................... 162

TABLEAU – ADVANCED ....................................................................................................... 167

50. Tableau ─ Dashboard ............................................................................................................................ 168


Creating a Dashboard ............................................................................................................................ 168

51. Tableau ─ Formatting............................................................................................................................ 174


Formatting the Axes .............................................................................................................................. 175
Change the Font .................................................................................................................................... 176
Change the Shade and Alignment .......................................................................................................... 177
Format Borders ..................................................................................................................................... 178

52. Tableau ─ Forecasting ........................................................................................................................... 179

6
Tableau
Creating a Forecast ................................................................................................................................ 179

53. Tableau ─ Trend Lines ........................................................................................................................... 183


Creating a Trend Line............................................................................................................................. 183

6
Tableau

6
Tableau

Tableau ─ Basics

1
TableauT
1. Tableau ─ Overview ableau

As a leading data visualization tool, Tableau has many desirable and unique features. Its
powerful data discovery and exploration application allows you to answer important
questions in seconds. You can use Tableau's drag and drop interface to visualize any data,
explore different views, and even combine multiple databases easily. It does not require
any complex scripting. Anyone who understands the business problems can address it with
a visualization of the relevant data. After analysis, sharing with others is as easy as
publishing to Tableau Server.

Tableau Features
Tableau provides solutions for all kinds of industries, departments, and data environments.
Following are some unique features which enable Tableau to handle diverse scenarios.

 Speed of Analysis: As it does not require high level of programming expertise,


any user with access to data can start using it to derive value from the data.

 Self-Reliant: Tableau does not need a complex software setup. The desktop
version which is used by most users is easily installed and contains all the features
needed to start and complete data analysis.

 Visual Discovery: The user explores and analyzes the data by using visual tools
like colors, trend lines, charts, and graphs. There is very little script to be written
as nearly everything is done by drag and drop.

 Blend Diverse Data Sets: Tableau allows you to blend different relational, semi-
structured and raw data sources in real time, without expensive up-front
integration costs. The users don’t need to know the details of how data is stored.

 Architecture Agnostic: Tableau works in all kinds of devices where data flows.
Hence, the user need not worry about specific hardware or software requirements
to use Tableau.

 Real-Time Collaboration: Tableau can filter, sort, and discuss data on the fly and
embed a live dashboard in portals like SharePoint site or Salesforce. You can save
your view of data and allow colleagues to subscribe to your interactive dashboards
so they see the very latest data just by refreshing their web browser.

 Centralized Data: Tableau server provides a centralized location to manage all of


the organization’s published data sources. You can delete, change permissions, add
tags, and manage schedules in one convenient location. It’s easy to schedule
extract refreshes and manage them in the data server. Administrators can centrally
define a schedule for extracts on the server for both incremental and full refreshes.

2
Tableau
2. Tableau ─ Environment Setup

In this chapter, you will learn about the environment setup of Tableau.

Download Tableau Desktop


The Free Personal Edition of Tableau Desktop can be downloaded from Tableau
Desktop. You need to register with your details to be able to download.

After downloading, the installation is a very straightforward process in which you need to
accept the license agreement and provide the target folder for installation. The following
steps and screenshots describe the entire setup process.

Start the Installation Wizard


Double-click the TableauDesktop-64bit-9-2-2.exe. It will present a screen to allow the
installation program to run. Click “Run”.

Accept the License Agreement


Read the license agreement and if you agree, choose the "I have read and accept the
terms of this license agreement" option. Then, click "Install".

3
Tableau

Start Trial
On completion of the installation, the screen prompts you with the option to Start the trial
now or later. You may choose to start it now. Also, if you have purchased Tableau then
you may enter the License key.

4
TTaabblleeaau

Provide Your Details


Provide your name and organization details. Then, click "Next".

Registration Complete
The registration completion screen appears. Click "Continue".

5
Tableau

Verify the Installation


You can verify the installation by going to the Windows start menu. Click the Tableau icon.
The following screen appears.

You are now ready to learn Tableau.

6
TTaabblleeaau
3. Tableau ─ Get Started

In this chapter, you will learn some basic operations in Tableau to get acquainted with its
interface. There are three basic steps involved in creating any Tableau data analysis report.
These three steps are:

 Connect to a data source: It involves locating the data and using an appropriate
type of connection to read the data.

 Choose dimensions and measures: This involves selecting the required columns
from the source data for analysis.

 Apply visualization technique: This involves applying required visualization


methods, such as a specific chart or graph type to the data being analyzed.

For convenience, let’s use the sample data set that comes with Tableau installation named
sample – superstore.xls. Locate the installation folder of Tableau and go to My Tableau
Repository. Under it, you will find the above file at Datasources\9.2\en_US-US.

Connect to a Data Source


On opening Tableau, you will get the start page showing various data sources. Under the
header “Connect”, you have options to choose a file or server or saved data source. Under
Files, choose excel. Then navigate to the file “Sample – Superstore.xls” as mentioned
above. The excel file has three sheets named Orders, People and Returns. Choose Orders.

Choose the Dimensions and Measures


Next, choose the data to be analyzed by deciding on the dimensions and measures.
Dimensions are the descriptive data while measures are numeric data. When put together,
they help visualize the performance of the dimensional data with respect to the data which

7
Tableau

are measures. Choose Category and Region as the dimensions and Sales as the
measure. Drag and drop them as shown in the following screenshot. The result shows the
total sales in each category for each region.

Apply Visualization Technique


In the previous step, you can see that the data is available only as numbers. You have to
read and calculate each of the values to judge the performance. However, you can see
them as graphs or charts with different colors to make a quicker judgment.

We drag and drop the sum (sales) column from the Marks tab to the Columns shelf. The
table showing the numeric values of sales now turns into a bar chart automatically.

8
Tableau

You can apply a technique of adding another dimension to the existing data. This will add
more colors to the existing bar chart as shown in the following screenshot.

9
4. Tableau ─ Navigation Tableau

In this chapter, you will get acquainted with various navigational features available in
Tableau interface. On running Tableau desktop, you get the menu at the top which shows
all the commands we can navigate. Let’s open a blank workbook and go through the
various important features under each menu.

Menu Commands
On closing the getting started window, you get the main interface with all the available
Menu commands. They represent the entire set of features available in Tableau. Various
sections of the menu are shown in the following diagram. Next, you can see some details
of each menu.

10
Tableau

FileMenu
This menu is used to create a new Tableau workbook and open existing workbooks from
both the local system and Tableau server. The important features in this menu are:

 Workbook Locale sets the language to be used in the report.

 Paste Sheets pastes a sheet into the current workbook, which is copied from
another workbook.

 Export Packaged Workbook option is used to create a packaged workbook,


which will be shared with other users.

11
Tableau

DataMenu
This menu is used to create new data source to fetch the data for analysis and
visualization. It also allows you to replace or upgrade the existing data source.

The important features in this menu are as follows:

 New Data Source allows to view all the types of connections available and choose
from it.

 Refresh All Extracts refreshes the data from the source.

 Edit Relationships option defines the fields in more than one data source for
linking.

12
Tableau

WorksheetMenu
This menu is used to create a new worksheet along with various display features such as
showing the title and captions, etc.

The important features in this menu are as follows:

 Show Summary allows to view the summary of the data used in the worksheet
such as, count, etc.

 Tooltip shows the tooltip when hovering above various data fields.

 Run Update option updates the worksheet data or filters used.

DashboardMenu
This menu is used to create a new dashboard along with various display features, such as
showing the title and exporting the image, etc.

13
Tableau

The important features in this menu are as follows:

 Format sets the layout in terms of colors and sections of the dashboard.

 Actions link the dashboard sheets to external URLs or other sheets.

 Export Image option exports an image of the Dashboard.

StoryMenu
This menu is used to create a new story which has many sheets or dashboards with related
data.

The important features in this menu are as follows:

 Format sets the layout in terms of colors and sections of the story.

 Run Update updates the story with the latest data from the source.

 Export Image option exports an image of the story.

14
Tableau

AnalysisMenu
This menu is used for analyzing the data present in the sheet. Tableau provides many out-
of-the-box features, such as calculating the percentage and performing a forecast, etc.

The important features in this menu are as follows:

 Forecast shows a forecast based on available data.

 Trend Lines shows the trend line for a series of data.

 Create Calculated Field option creates additional fields based on certain


calculation on the existing fields.

15
Tableau

MapMenu
This menu is used for building map views in Tableau. You can assign geographic roles to
fields in your data.

The important features in this menu are as follows:

 Map Layers hides and shows map layers, such as street names, country borders,
and adds data layers.

 Geocoding creates new geographic roles and assigns them to the geographic fields
in your data.

16
Tableau

Format Menu
This menu is used for applying the various formatting options to enhance the look and feel
of the dashboards created. It provides features such as borders, colors, alignment of text,
etc.

The important features in this menu are as follows:

 Borders applies borders to the fields displayed in the report.


 Title & Caption assigns a title and caption to the reports.
 Cell Size customizes the size of the cells displaying the data.
 Workbook Theme applies a theme to the entire workbook.

17
Tableau

Server Menu
Server Menu is used to login to the Tableau server if you have access, and publish your
results to be used by others. It is also used to access the workbooks published by others.

The important features in this menu are as follows:

 Publish Workbook publishes the workbook in the server to be used by others.

 Publish Data Source publishes the source data used in the workbook.

 Create User Filters creates filters on the worksheet to be applied by various users
while accessing the report.

18
Tableau

19
TTaabblleeaau

As Tableau helps in analyzing lots of data over diverse time periods, dimensions, and
measures, it needs a very meticulous planning to create a good dashboard or story. Hence,
it is important to know the approach to design a good dashboard. Like any other field of
human endeavor, there are many best practices to be followed to create good worksheets
and dashboards.

Though the final outcome expected from a Tableau project is ideally a dashboard with
story, there are many intermediate steps which needs to be completed to reach this goal.
Following is a flow diagram of design steps that should be ideally followed to create
effective dashboards.

Connect to Data Source


Tableau connects to all popular data sources. It has inbuilt connectors which take care of
establishing the connection, once the connection parameters are supplied. Be it simple
text files, relational sources, SQL sources or cloud data bases, Tableau connects to nearly
every data source.

20
5. Tableau ─ Design Flow
Build Data Views
After connecting to a data source, you get all the column and data available in the Tableau
environment. You classify them as dimensions and measures, and create any hierarchy
required. Using these you build views, which are traditionally known as Reports. Tableau
provides easy drag and drop feature to build views.

Enhance the Views


The views created above needs to be enhanced further by the use of filters, aggregations,
labeling of axes, formatting of colors and borders, etc.

Create Worksheets
Create different worksheets to create different views on the same or different data.

Create and Organize Dashboards


Dashboards contain multiple worksheets which are linked. Hence, the action in any of the
worksheet can change the result in the dashboard accordingly.

Create a Story
A story is a sheet that contains a sequence of worksheets or dashboards that work together
to convey information. You can create stories to show how facts are connected, provide
context, demonstrate how decisions relate to outcomes, or simply make a compelling case.

21
TTaabblleeaau

The result of data analysis in Tableau can be saved in various formats, to be saved and
distributed. The various formats are referred as different file types and they are identified
by different extensions. Their formats depend on how they are produced and for what
purposes they are used. They are all stored as XML files, which can be opened and edited.

Following table lists the description of each file type and their usage.

File
Purpose
Extension
File Type

It contains information on each sheet and dashboard that


Tableau is present in a workbook. It has the details of the fields,
.twb which are used in each view and the formula applied to
Workbook
the aggregation of the measures. It also has the
formatting and styles applied. It contains the data source
connection information and any metadata information
created for that connection.

Tableau
Packaged .twbx This file format contains the details of a workbook as well
Workbook as the local data that is used in the analysis. Its purpose
is to share with other Tableau desktop or Tableau reader
users, assuming it does not need data from the server.

Tableau The details of the connection used to create the tableau


.tds
Data Source report are stored in this file. In the connection details, it
stores the source type (excel/relational/sap, etc.) as well
as the data types of the columns.

This file is similar to the .tds file with the addition of data
Tableau .tdsx
along with the connection details.
Packaged
Data source

22
6. Tableau ─ File Types

This file contains the data used in a .twb file in a highly


Tableau Data
.tde compressed columnar data format. This helps in storage
Extract
optimization. It also saves the aggregated calculations
that are applied in the analysis. This file should be
refreshed to get the updated data from the source.

.tbm
Tableau These files contain a single worksheet that is shared
Bookmark easily to be pasted into other workbooks.

Tableau
.tps This file stores the color preference used across all the
Preferences
workbooks. It is mainly used for consistent look and feel
across the users.

23
TTaabblleeaau

As a data analysis tool, Tableau classifies every piece of data into one of the four categories
namely - String, Number, Boolean and datetime. Once data is loaded from the source,
Tableau automatically assigns the data types. Contrarily, you can also change some of the
data types if it satisfies the data conversion rule. The user has to specify the data type for
calculated fields.

Following table lists the description of data types supported by Tableau.

Data Type Description Example

STRING Any sequence of zero or more characters. They are 'Hello'


enclosed within single quotes. The quote itself can be 'Quoted'
included in a string by writing it twice. 'quote'

3
NUMBER These are either integers or floating points. It is 142.58
advised to round the floating point numbers while
using them in calculations.

TRUE
BOOLEAN They are logical values.
FALSE

DATE &
Tableau recognizes dates in almost all formats. But in "02/01/2015"
DATETIME
case we need to force Tableau to recognize a string "#3 March
as date, then we put a # sign before the data. 1982"

24
7.8. Tableau
Tableau──Data
Show Me
Types Tableau

As an advanced data visualization tool, Tableau makes the data analysis very easy by
providing many analysis techniques without writing any custom code. One such feature is
Show Me. It can be used to apply a required view to the existing data in the worksheet.
Those views can be a pie chart, scatter plot, or a line chart.

Whenever a worksheet with data is created, it is available in the top right corner as shown
in the following figure. Some of the view options will be greyed out depending on the
nature of selection in the data pane.

25
Tableau

Show Me with Two Fields


The relation between two fields can be visually analyzed easily by using various graphs
and charts available in Show Me. In this case, we choose two fields and apply a line chart.
Following are the steps:

 Step 1: Select the two fields (order date and profit) to be analyzed by holding the
control key.

 Step 2: Click the Show Me bar and choose line chart.

 Step 3: Click the Mark Label button on the scrollbar.

The following diagram shows the line chart created using the above steps.

26
7. Tableau ─ Data Types
Show Me with Multiple Fields
We can apply a similar technique as above to analyze more than 2 fields. The only
difference in this case will be the availability of fewer views in active form. Tableau
automatically greys out the views that are not appropriate for the analysis of the fields
chosen.

In this case, choose the field’s product name, customer name, sales and profit by holding
down the control key. As you can observe, most of the views in Show Me are greyed out.
From the active views, choose Scatter View.

The following diagram shows the Scatter View chart created.

27
TTaabblleeaau
9. Tableau ─ Data Terminology

As a powerful data visualization tool, Tableau has many unique terms and definitions. You
need to get acquainted with their meaning before you start using the features in Tableau.
The following list of terms is comprehensive and explains the terms most frequently used.

Term Meaning

An alternative name that you can assign to a field or to a dimension


Alias
member.

Bin A user-defined grouping of measures in the data source.

A .tbm file in the Bookmarks folder in the Tableau repository that


Bookmark contains a single worksheet. Much like web browser bookmarks,
.tbm files are a convenient way to quickly display different analyses.

Calculated A new field that you create by using a formula to modify the existing
Field fields in your data source.

A text table view. Use text tables to display the numbers associated
Crosstab
with dimension members.

A combination of several views arranged on a single page. Use


Dashboard dashboards to compare and monitor a variety of data
simultaneously.

A pane on the left side of the workbook that displays the fields of
the data sources to which Tableau is connected. The fields are
divided into dimensions and measures. The data pane also displays
Data Pane
custom fields such as calculations, binned fields, and groups. You
build views of your data by dragging fields from the data pane onto
the various shelves that are a part of every worksheet.

A page where you can set up your data source. The data source
Data Source
page generally consists of four main areas: left pane, join area,
Page
preview area, and metadata area.

A field of categorical data. Dimensions typically hold discrete data


such as hierarchies and members that cannot be aggregated.
Dimension
Examples of dimensions include dates, customer names, and
customer segments.

A saved subset of a data source that you can use to improve


performance and analyze offline. You can create an extract by
Extract
defining filters and limits that include the data you want in the
extract.

28
Tableau

A shelf on the left of the workbook that you can use to exclude data
Filters Shelf
from a view by filtering it using measures and dimensions.

A pane that contains formatting settings that control the entire


Format Pane worksheet, as well as individual fields in the view. When open, the
Format pane appears on the left side of the workbook.

Level Of Detail A syntax that supports aggregation at dimensionalities other than


(LOD) the view level. With the level of detail expressions, you can attach
Expression one or more dimensions to any aggregate expression.

A part of the view that visually represents one or more rows in a


Marks data source. A mark can be, for example, a bar, line, or square. You
can control the type, color, and size of marks.

A card to the left of the view, where you can drag fields to control
Marks Card mark properties such as type, color, size, shape, label, tooltip, and
detail.

A shelf to the left of the view that you can use to split a view into a
sequence of pages based on the members and values in a discrete
Pages Shelf or continuous field. Adding a field to the Pages shelf is like adding a
field to the Rows shelf, except that a new page is created for each
new row.

A shelf at the top of the workbook that you can use to create the
rows of a data table. The shelf accepts any number of dimensions
and measures. When you place a dimension on the Rows shelf,
Rows Shelf
Tableau creates headers for the members of that dimension. When
you place a measure on the Rows shelf, Tableau creates quantitative
axes for that measure.

Named areas to the left and top of the view. You build views by
placing fields onto the shelves. Some shelves are available only
Shelves
when you select certain mark types. For example, the Shape shelf is
available only when you select the Shape mark type.

A file with a .twb extension that contains one or more worksheets


Workbook
(and possibly also dashboards and stories).

A sheet where you build views of your data by dragging fields onto
Worksheet
shelves.

29
Tableau

Tableau ─ Data Sources

30
TTaabblleeaau

Tableau can connect to all the popular data sources which are widely used. Tableau’s
native connectors can connect to the following types of data sources.

 File Systems such as CSV, Excel, etc.


 Relational Systems such as Oracle, Sql Server, DB2, etc.
 Cloud Systems such as Windows Azure, Google BigQuery, etc.
 Other Sources using ODBC

The following picture shows most of the data sources available through Tableau’s native
data connectors.

31
10. Tableau ─ Data Sources
Connect Live
The Connect Live feature is used for real-time data analysis. In this case, Tableau connects
to real-time data source and keeps reading the data. Thus, the result of the analysis is up
to the second, and the latest changes are reflected in the result. However, on the
downside, it burdens the source system as it has to keep sending the data to Tableau.

In-Memory
Tableau can also process data in-memory by caching them in memory and not being
connected to the source anymore while analyzing the data. Of course, there will be a limit
to the amount of data cached depending on the availability of memory.

Combine Data Sources


Tableau can connect to different data sources at the same time. For example, in a single
workbook you can connect to a flat file and a relational source by defining multiple
connections. This is used in data blending, which is a very unique feature in Tableau.

32
TTaabblleeaau

A custom data view is used to extend the normal data views with some additional features
so that the view can give different types of charts for the same underlying data. For
example, you can drill down a dimension field which is part of a pre-defined hierarchy so
that additional values of the measures are obtained at a different granularity. Following
are some of the frequently used and important custom data views Tableau offers.

Drill Down View


For dimension fields which are part of a hierarchy, you usually need to know the result of
analysis for the next or previous level of aggregation. For example, when you know the
result for a quarter, you get interested to know the results for each month in that quarter,
and you may even need the result for each week. This is a case of drilling down the existing
dimensions to get a finer level of granularity.

To drill down and drill up for individual dimension members in a hierarchy, right-click a
table header and select Drill Down from the context menu. Consider a bar chart created
with the dimension category in the columns shelf and the measure Sales in the Rows shelf.
Right-click on the bar representing Furniture and select Drill Down.

33
11. Tableau ─ Custom Data View
The result of the drill down action is shown in the following screenshot.

Swapping Dimensions
You can create a new view from an existing view by swapping the position of the
dimensions. This does not change the values of the measures, but it does change the
position of the measures. Consider a view for analyzing the Profit for each year for each
segment and category of products. You can click on the vertical line at the end of category
column and drag it to the segment column. This action is shown in the following
screenshot.

34
Tableau

The result of the swapping of the two dimensions is shown in the following screenshot. As
you can see, only the position of the values of the measure Profit changes for each
category and segment, and not its value.

35
TTaabblleeaau
12. Tableau ─ Extracting Data

Data extraction in Tableau creates a subset of data from the data source. This is useful in
increasing the performance by applying filters. It also helps in applying some features of
Tableau to data which may not be available in the data source like finding the distinct
values in the data. However, the data extract feature is most frequently used for creating
an extract to be stored in the local drive for offline access by Tableau.

Creating an Extract
Extraction of data is done by following the menu - Data -> Extract Data. It creates many
options such as applying limits to how many rows to be extracted and whether to
aggregate data for dimensions. The following screen shows the Extract Data option.

36
Tableau

Applying Extract Filters


To extract a subset of data from the data source, you can create filters which will return
only the relevant rows. Let’s consider the Sample Superstore data set and create an
extract. In the filter option, choose Select from list and tick mark the checkbox value for
which you need to pull the data from the source.

37
TTaabblleeaau

Adding New Datato Extract


To add more data for an already created extract, you can choose the option Data ->
Extract -> Append Data from File. In this case, browse the file containing the data and
click OK to finish. Of course, the number and datatype of columns in the file should be in
sync with the existing data.

38
Tableau

Extract History
You can verify the history of data extracts to be sure about how many times the extract
has happened and at what times.

For this, you can use the menu - Data -> Extract History.

39
TTaabblleeaau
13. Tableau ─ Fields Operations

Tableau has many features to manipulate the fields present in Tableau data pane. You can
rename the fields or combine two fields to create one field. Such operations help in better
organization of the dimensions and measures, as well as accommodate two or more fields
with the same name for better data analysis.

Following are the important examples of such Field Operations.

Adding Fieldsto Worksheet


You can add any field to the worksheet by right-clicking and choosing the option Add to
Sheet. You can also drag and drop the fields into different shelves present in the
worksheet, like Columns shelf, Rows shelf, Filters shelf, and many other shelves under the
Marks card. The following diagram shows the right-click option.

40
Tableau

Combining Two Fields


You can combine two dimension fields to create one field. This combined field has a name
which is a combination of the individual fields. The values in the dimension get combined
to a single value by joining the two strings into one string separated by a comma. However,
this default name can be changed by using the rename field operation. The following
diagram shows the step to combine two fields.

Searching Fields
You can search for names of fields by using the search box option. Writing first three or
more letters of the field name brings out the result showing only the fields whose name
contains these letters.

41
TTaabblleeaau

Reordering Fields
You can change the position of fields by simply dragging them up and down. In the
following example, we drag the field customer name to the place between state and city.
This is usually done to bring similar fields together which are frequently used for analysis.

42
Tableau

43
14. Tableau ─ Editing Metadata TTaabblleeaau

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 views. You can browse the metadata and change some of its
properties for some specific requirements.

Checking theMetadata
After connecting to a data source, Tableau presents all possible tables and columns present
in the source. Consider the source ‘Sample Coffee shop’ for checking the metadata. Click
the Data menu and choose to connect to a data source. Browse for the MS access file
named ‘Sample - Coffee shop’. Drag the table named Product to the data canvas. On
choosing the file, you get the following screen which shows the column names, their data
types. The string data types are shown as Abc and Numeric data types are shown as #.

44
Tableau

Changing the DataType


You can change the datatype of some of the fields if required. Depending on the nature of
source data, sometimes Tableau may fail to recognize the data type from the source. In
such scenarios, we can manually edit the data type. The following screenshot shows the
option.

45
TTaabblleeaau

Renaming and Hiding


The column names can be changed by using the renaming option. You can also hide a
column so that it does not appear in the data view that you create. These options are
available by clicking on the data type icon in the metadata grid as shown in the following
screenshot.

46
Tableau

ColumnAlias
Each column of the data source can be assigned an alias which helps better understand
the nature of the column. You can choose the aliases option from the above step and the
following screen comes up which is used to create or edit aliases.

47
TTaabblleeaau
15. Tableau ─ Data Joining

Data joining is a very common requirement in any data analysis. You may need to join
data from multiple sources or join data from different tables in a single source. Tableau
provides the feature to join the table by using the data pane available under Edit Data
Source in the Data menu.

Creating a Join
Consider the data source ‘Sample superstore’ to create a join between Orders and Returns
table. For this, go to the Data menu and choose the option Edit Data Source. Next, drag
the two tables, Orders and Returns to the data pane. Depending on the field name and
datatype, Tableau will automatically create a join which can be changed later.

The following screenshot shows the creation of an inner join between Orders and Returns
using the Field Order ID.

48
Tableau

Editing a Join Type


The type of join which the table creates automatically can be changed manually. For this,
click the middle of the two circles showing the join. A popup window appears below which
shows the four types of joins available. Also Tableau automatically greys out some types
of joins, which it finds irrelevant on the basis of data present in the data source.

In the following screenshot, you can see the inner and left outer join as the available joins.

49
Tableau

Editing Join Fields


You can also change the fields forming the join condition by clicking the Data Source option
available in the join popup window. While selecting the field, you can also search for the
field you are looking for using a search text box.

50
16. Tableau ─ Data Blending Tableau

Data Blending is a very powerful feature in Tableau. It is used when there is related data
in multiple data sources, which you want to analyze together in a single view. As an
example, consider the Sales data is present in a relational database and Sales Target data
in an Excel spreadsheet. Now, to compare actual sales to target sales, you can blend the
data based on common dimensions to get access to the Sales Target measure. The two
sources involved in data blending are referred as primary and secondary data sources. A
left join is created between the primary data source and the secondary data source with
all the data rows from primary and matching data rows from secondary data source.

Preparing Datafor Blending


Tableau has two inbuilt data sources named Sample-superstore and Sample coffee
chain.mdb which will be used to illustrate data blending.

First load the sample coffee chain to Tableau and look at its metadata. Go to the menu -
Data -> New Data Source and browse for the sample coffee chain file, which is a MS Access
database file. The following screenshot shows the different tables and joins available in
the file.

51
Tableau

Adding Secondary Data Source


Next, add the secondary data source named Sample-superstore by again following the
steps - Data -> New Data Source and choosing this data source. Both the data sources
now appear on the Data window as shown in the following screenshot.

52
TTaabblleeaau

Blending the Data


Now you can integrate the data from both the above sources based on a common
dimension. Note that a small chain image appears next to the dimension named State.
This indicates the common dimension between the two data sources. Drag the State field
from the primary data source to the rows shelf and the field Profit Ratio from the secondary
data source to the Columns shelf. Then, select the bullet chart option from Show Me to
get the bullet chart shown in the following screenshot. The chart shows how the profit
ratio varies for each state in both the superstore and coffee chain shops.

53
Tableau

Tableau - Worksheets

54
Tableau
17. Tableau ─ Add Worksheets

Worksheet in the Tableau screen is the area where you create the views for data analysis.
By default, Tableau provides three blank worksheets when you have established a
connection to data source. You can go on adding multiple worksheets to look at different
data views in the same screen, one after another.

Adding a Worksheet
You can add a worksheet in two ways. Right-click on the name of the current worksheet
and choose the option New Worksheet from the pop-up menu. You can also click on the
small icon to the right of the last sheet name to add a worksheet.

55
Tableau

Quick Preview of a Worksheet


Staying in one worksheet, you can have a quick preview of another worksheet by hovering
the mouse on the name of the other worksheet.

56
TTaabblleeaau

You can give appropriate names to the existing worksheets by renaming a worksheet. This
helps in relating the content of the worksheet with its name. For example, if we want to
know which sheet has the view to know the segment wise profit then with a proper name
of the sheet we can identify it.

Renaming the Worksheet


To rename a worksheet, right-click the sheet name and choose the option Rename Sheet.

57
18. Tableau ─ Rename Worksheet
The following diagram shows the worksheet with the new name.

58
TTaabblleeaau

An existing worksheet can be both saved and deleted. This helps in organizing the contents
in the Tableau desktop environment. While you can save a worksheet by clicking the save
button under the main menu, you can delete a worksheet using the following steps.

Deleting the Worksheet


To delete a worksheet, right-click on name of the worksheet and choose the option ‘Delete
Sheet’.

59
19. Tableau ─ Save & Delete Worksheet
The following screenshot shows the worksheet has been deleted.

60
TTaabblleeaau

Sometimes you need to change the position of the existing worksheet to study them in a
better way. This can be done in a simple way by dragging the sheet name from its existing
position to the new position.

Reordering the Worksheet


To reorder a worksheet, click and hold the worksheet name and move it to the desired
position. Consider the three worksheets as shown in the following screenshot.

61
20. Tableau ─ Reorder Worksheet
The following screenshot shows that a vertical dark line appears in the new position on
dragging the third worksheet from left to the new position.

62
TTaabblleeaau

A paged workbook is used to save the view of the data in different pages for different
values of the dimension or measure. A common example is to see how each type of
products have performed against each other in a specific sales region. As each of the
values of product type is stored as a separate page, we can view them one at a time or
see it as a range of values.

Creating Paged Workbook


The paged workbook contains worksheets which have fields put in the page shelf. Consider
an example of studying the profit of various sub-category of products in different regions.
Following are the steps.

Step 1: Create a bar chart with two dimensions and one measure. In this case, drag the
Measure Profit to the columns shelf and the dimensions sub-category, and Region to the
rows shelf as shown in the following screenshot.

63
21. Tableau ─ Paged Workbook
Step 2: Drag the Sub-Category field again to the page shelf. You will see that a page
control is automatically added, just below the Pages shelf. This page control provides the
following features to navigate through the pages in a view:

 Jump to a specific page


 Manually advance through the pages
 Automatically advance through pages

In this case, we will see how to jump to a specific page and how to get the automatic
display of pages. To go to a specific page, click on the drop-down on the page control and
select Accessories. The chart seen in the following screenshot appears.

64
Tableau

Step 3: For automatic display of pages, keep the show history checkbox ticked and click
the play button. You can then see an automatic play of different pages of sub categories.
While the current Sub-Category value is shown with a dark color, the previous values are
shaded with light color. The following screenshot illustrates this.

65
21. Tableau ─ Paged Workbook

Tableau ─ Calculations

66
TableauT
22. Tableau ─ Operators ableau

An operator is a symbol that tells the compiler to perform specific mathematical or logical
manipulations. Tableau has a number of operators used to create calculated fields and
formulas.

Following are the details of the operators that are available and the order (precedence) of
operations.

Types of Operator
 General Operators
 Arithmetic Operators
 Relational Operators
 Logical Operators

General Operators
Following table shows the general operators supported by Tableau. These operators act
on numeric, character, and date data types.

Operator Description Example

Adds two numbers. 7+3


+(addition) Concatenates two strings. Profit + Sales
Adds days to dates. 'abc' + 'def' = 'abcdef'
#April 15, 2004# + 15 = #April 30,
2004#


(subtraction) Subtracts two numbers. -(7+3) = -10
Subtracts days from #April 16, 2004# - 15 = #April 1,
dates. 2004#

67
Tableau

Arithmetic Operators
Following table shows the arithmetic operators supported by Tableau. These operators act
only on numeric data types.

Operator Description Example

*(Multiplication) Numeric multiplication 23*2 = 46

/(Division) Numeric division 45/2 = 22.5

%(modulo) Reminder of numeric division 13 % 2 = 1

^(power) Raised to the power 2^3 = 8

Comparison Operators
Following table lists the comparison operators supported by Tableau. These operators are
used in expressions. Each operator compares two numbers, dates, or strings and returns
a Boolean (TRUE or FALSE). Booleans themselves, however, cannot be compared using
these operators.

Operator Description Example

= = or =
Compares two numbers or two strings or two dates to ‘Hello’ =
(Equal to)
be equal. Returns the Boolean value TRUE if they are, ‘Hello’
else returns false. 5 = 15/ 3

!= or <> (Not
equal to) Compares two numbers or two strings or two dates to ‘Good’ <>
be unequal. Returns the Boolean value TRUE if they are, ‘Bad’
else returns false. 18 != 37 / 2

68
TTaabblleeaau

> (Greater Compares two numbers or two strings or two dates [Profit] > 20000
than) where the first argument is greater than second. [Category] > ‘Q’
Returns the boolean value TRUE if it is the case, else [Ship date] >
returns false. #April 1, 2004#

[Profit] < 20000


< (Less Compares two numbers or two strings or two dates [Category] < ‘Q’
than) where the first argument is smaller than second. [Ship date] <
Returns the boolean value TRUE if it is the case, else #April 1, 2004#
returns false.

Logical Operators
Following table shows the logical operators supported by Tableau. These operators are
used in expressions whose result is a Boolean giving the output as TRUE or FALSE.

Operator Description Example

AND If the expressions or Boolean values present on both [Ship Date] > #April
sides of AND operator is evaluated to be TRUE, then 1, 2012# AND
the result is TRUE. Else the result is FALSE. [Profit] > 10000

[Ship Date] > #April


OR If any one or both of the expressions or Boolean 1, 2012# OR [Profit]
values present on both sides of AND operator is > 10000
evaluated to be TRUE, then the result is TRUE. Else
the result is FALSE.

NOT [Ship Date] >


This operator negates the Boolean value of the #April 1, 2012#
NOT
expression present after it.

Operator Precedence
The following table describes the order in which operators are evaluated. The top row has
the highest precedence. Operators on the same row have the same precedence. If two
operators have the same precedence, they are evaluated from left to right in the formula.
Also parentheses can be used. The inner parentheses are evaluated before the outer
parentheses.

69
Tableau

Precedence Operator

1 –(negate)

2 ^(power)

3 *, /, %

4 +, –

5 ==, >, <, >=, <=, !=

6 NOT

7 AND

8 OR

70
23. Tableau ─ Functions TTaabblleeaau

Any data analysis involves a lot of calculations. In Tableau, the calculation editor is used
to apply calculations to the fields being analyzed. Tableau has a number of inbuilt functions
which help in creating expressions for complex calculations.

Following are the description of different categories of functions.

 Number Functions
 String Functions
 Date Functions
 Logical Functions
 Aggregate Functions

Number Functions
These are the functions used for numeric calculations. They only take numbers as inputs.
Following are some examples of important number functions.

Function Description Example

Rounds a number to the nearest


CEILING (number) CEILING(2.145) = 3
integer of equal or greater value.

POWER (number, Raises the number to the specified


POWER(5,3) = 125
power) power.

ROUND (number, Rounds the numbers to a specified ROUND(3.14152,2) =


[decimals]) number of digits. 3.14

String Functions
String Functions are used for string manipulation. Following are some important string
functions with examples.

Function Description Example

Returns the length of the


LEN (string) LEN("Tableau") = 7
string.

71
Tableau

Returns the string with any


LTRIM (string) LTRIM(" Tableau ") = "Tableau"
leading spaces removed.

REPLACE (string, Searches the string for REPLACE("GreenBlueGreen",


substring, substring and replaces it with "Blue", "Red") =
replacement) a replacement. If the "GreenRedGreen"
substring is not found, the
string is not changed.

Returns string, with all


UPPER (string) UPPER("Tableau") = "TABLEAU"
characters uppercase.

Date Functions
Tableau has a variety of date functions to carry out calculations involving dates. All the
date functions use the date_part which is a string indicating the part of the date such as
- month, day, or year. Following table lists some examples of important date functions.

Function Description Example

DATEADD ('month', 3,
DATEADD (date_part, Returns an increment added #2004-04-15#) = 2004-07-
increment, date) to the date. The type of 15 12:00:00 AM
increment is specified in
date_part.

DATENAME
DATENAME('month', #2004-
(date_part, date, Returns date_part of date as 04-15#) = "April"
[start_of_week]) a string. The start_of_week
parameter is optional.

Returns the day of the given


DAY (date) DAY(#2004-04-12#) = 12
date as an integer.

Returns the current date and NOW( ) = 2004-04-15


NOW( )
time. 1:08:21 PM

7 72
Tableau

Logical Functions
These functions evaluate some single value or the result of an expression and produce a
boolean output.

Function Description Example

IFNULL
(expression1, The IFNULL function returns the first IFNULL([Sales], 0) =
expression2) expression if the result is not null, and [Sales]
returns the second expression if it is
null.

ISDATE("11/05/98") =
TRUE
ISDATE (string) The ISDATE function returns TRUE if the ISDATE("14/05/98") =
string argument can be converted to a FALSE
date, and FALSE if it cannot.

MIN (expression) The MIN function returns the minimum


of an expression across all records or
the minimum of two expressions for
each record.

Aggregate Functions

Function Description Example

Returns the average of all the values in


AVG the expression. AVG can be used with
(expression) numeric fields only. Null values are
ignored.

COUNT Returns the number of items in a group.


(expression) Null values are not counted.

Returns the median of an expression


MEDIAN across all records. Median can only be
(expression) used with numeric fields. Null values are
ignored.

Returns the statistical standard deviation


STDEV
of all values in the given expression based
(expression)
on a sample of the population.

7 73
24. Tableau ─ Numeric Calculations Tableau

Numeric calculations in Tableau are done using a wide range of inbuilt functions available
in the formula editor.

In this chapter, we will see how to apply calculations to the fields. The calculations can be
as simple as subtracting the values of two fields or applying an aggregate function to a
single field.

Following are the steps to create a calculation field and use numeric functions in it.

Create Calculated Field


While connected to Sample-superstore, go to the Analysis menu and click ‘Create
Calculated Field’, as shown in the following screenshot.

74
Tableau

Calculation Editor
The above step opens a calculation editor which lists all the functions that is available in
Tableau. You can change the dropdown value and see only the functions related to
numbers.

Create a Formula
To study the difference between profit and discount for different shipping mode of the
products, create a formula subtracting the discount from the profit as shown in the
following screenshot. Also, name this field as profit_n_discount.

75
Tableau

Using the Calculated Field


The above calculated field can be used in the view by dragging it to the Rows shelf as
shown in the following screenshot. It produces a bar chart showing the difference between
profit and discount for different shipping modes.

76
Tableau

Applying Aggregate Calculations


In a similar manner as above, you can create a calculated field using aggregate function.
Here, create AVG(sales) values for different ship mode. Write the formula in the calculation
editor as shown in the following screenshot.

77
Tableau

On clicking OK and dragging the Avg_Sales field to the Rows shelf, you will get the
following view.

78
Tableau

79
25. Tableau ─ String Calculations Tableau

In this chapter, you will learn about calculations in Tableau involving Strings. Tableau has
many inbuilt string functions, which can be used to do string manipulations such as -
comparing, concatenating, replacing few characters from a string, etc. Following are the
steps to create a calculation field and use string functions in it.

Create Calculated Field


While connected to Sample superstore, go to the Analysis menu and click ‘Create
Calculated Field’ as shown in the following screenshot.

Calculation Editor
The above step opens a calculation editor which lists all the functions that is available in
Tableau. You can change the dropdown value and see only the functions related to strings.

80
Tableau

Create a Formula
Consider you want to find out the sales in the cities, which contain the letter “o”. For this,
create the formula as shown in the following screenshot.

Using the Calculated Field


Now, to see the created field in action, you can drag it to the Rows shelf and drag the
Sales field to the Columns shelf. The following screenshot shows the Sales values.

81
Tableau

82
26. Tableau ─ Date Calculations Tableau

Dates are one of the key fields which is extensively used in most of the data analysis
scenarios. Hence, Tableau provides a large number of inbuilt functions involving dates.
You can carry out simple date manipulations such as adding or subtracting days from a
date. You can also create complex expressions involving dates.

Following are the steps to create a calculation field and use date functions in it.

Create Calculated Field


While connected to Sample superstore, go to the Analysis menu and click ‘Create
Calculated Field’, as shown in the following screenshot.

83
Tableau

Calculation Editor
The above step opens a calculation editor, which lists all the functions available in Tableau.
You can change the dropdown value and see only the functions related to Date.

Create a Formula
Now, find out the sales volume along with the difference in the date of sales in months
from 21st March 2009. For this, create the formula as shown in the following screenshot.

84
TTaabblleeaau

Using the Calculated Field


Now to see the created field in action, you can drag it to the Rows shelf and drag the Sales
field to the Columns shelf. Also drag the ship Date with months. The following screenshot
shows the Sales values.

85
Tableau
27. Tableau ─ Table Calculations

These are the calculations which are applied to the values in the entire table. For example,
for calculating a running total or running average, we need to apply a single method of
calculation to an entire column. Such calculations cannot be performed on some selected
rows.

Table has a feature called Quick Table Calculation, which is used to create such
calculations. The steps to be applied in Quick Table calculation are as follows:

Step 1: Select the measure on which the table calculation has to be applied and drag it
to column shelf.

Step 2: Right-click the measure and choose the option Quick Table Calculation.

Step 3: Choose one of the following options to be applied on the measure.

 Running Total
 Difference
 Percent Difference
 Percent of Total
 Rank
 Percentile
 Moving Average
 Year to Date (YTD) Total
 Compound Growth Rate
 Year over Year Growth
 Year to Date (YTD) Growth

Example
Let’s calculate the running total of the profits earned for the data source following the
above steps. Use the data source named sample – superstore.xls.

86
TableauT
28. Tableau ─ LOD Expressions ableau

Level of Detail (LOD) expressions are used to run complex queries involving many
dimensions at the data source level instead of bringing all the data to Tableau interface. A
simple example is adding dimension to an already calculated aggregate value.

Types of LOD
There are three main types of LOD expressions.

 FIXED LOD: This expression computes values using the specified dimensions
without reference to any other dimensions in the view.

 INCLUDE LOD: This level of detail expressions compute values using the specified
dimensions in addition to whatever dimensions are in the view.

 EXCLUDE LOD: These levels of detail expressions subtract dimensions from the
view level of detail.

FIXED Level of Detail Expressions


Find the amount of Sales for each state in each region. Here, first create the formula field
named Regional Sales using the formula as shown in the following screenshot.

87
Tableau

Next, drag the Region and State field to the Rows shelf and the calculated field to the Text
shelf under the Marks card. Also drag the Region field to the Color shelf. This produces the
following view, which shows a fixed value for different states. That is because we have
fixed the dimension as region for the calculation of Sales value.

88
Tableau

INCLUDE Level of Detail Expressions


INCLUDE level of detail expressions compute values using the specified dimensions in
addition to whatever dimensions are in the view. Calculate the sum of sales per state for
each sub-category of products.

For this, drag the Sub-Category field to the Rows shelf. Then, write the expression in the
Columns shelf as shown in the following screenshot. It produces the following view which
includes both the dimensions in the calculations.

89
Tableau

EXCLUDE Level of Detail Expressions


EXCLUDE level of detail expressions specify dimensions to exclude from the view level of
detail. Exclude Region from Sales figure calculated for every month. Create the
formula as shown in the following screenshot.

90
Tableau

On dragging the relevant fields to the respective shelves, you will get the final view for
the EXCLUDE LOD as shown in the following screenshot.

91
Tableau

Tableau ─ Sort & Filters

92
29. Tableau ─ Basic Sorting Tableau

Sorting of data is a very important feature of data analysis. Tableau allows the sorting of
data of the fields, which are called dimensions. There are two ways in which Tableau carries
out the sorting.

 Computed Sorting is the sort directly applied on an axis using the sort dialog
button.

 Manual Sorting is used to rearrange the order of dimension fields by dragging


them next to each other in an ad hoc fashion.

Computed Sorting
This type of sorting involves choosing a field to be sorted and directly applying the sort
using the sort dialog box. You have the option to choose the sort order as ascending or
descending and choose the field on which to apply the sort.

ExampleS
Choose Sample-Superstore to apply sorting on the field named discount by using the
dimensions order date and Subcategory as shown below. The result shows the name of
the sub-categories in a descending order arranged for each year.

Manual Sorting
This is basically changing the order in which the visualization elements appear in the
screen. For example, you want to show the sales volume of different product segment in
a descending order, however you have your own choice of order. This sort is not as per
the exact values of number or text, rather they represent the user’s choice of ordering.
Hence, they are called as manual sorting.

In the following example, you move the segment named Home Office, below the segment
named Consumer, even though the sales volume of Home Office is the lowest.

93

You might also like