The Tableau Workshop - Sumit Gupta - E-Book

The Tableau Workshop E-Book

Sumit Gupta

0,0
34,79 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

Learning Tableau has never been easier, thanks to this practical introduction to storytelling with data. The Tableau Workshop breaks down the analytical process into five steps: data preparation, data exploration, data analysis, interactivity, and distribution of dashboards. Each stage is addressed with a clear walkthrough of the key tools and techniques you'll need, as well as engaging real-world examples, meaningful data, and practical exercises to give you valuable hands-on experience.

As you work through the book, you'll learn Tableau step by step, studying how to clean, shape, and combine data, as well as how to choose the most suitable charts for any given scenario. You'll load data from various sources and formats, perform data engineering to create new data that delivers deeper insights, and create interactive dashboards that engage end-users.

All concepts are introduced with clear, simple explanations and demonstrated through realistic example scenarios. You'll simulate real-world data science projects with use cases such as traffic violations, urban populations, coffee store sales, and air travel delays.

By the end of this Tableau book, you'll have the skills and knowledge to confidently present analytical results and make data-driven decisions.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 511

Veröffentlichungsjahr: 2022

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



The

Tableau Workshop

A practical guide to the art of data visualization with Tableau

Sumit Gupta, Sylvester Pinto, Shweta Sankhe-Savale, JC Gillet, and Kenneth Michael Cherven

The Tableau Workshop

Copyright © 2022 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Authors: Sumit Gupta, Sylvester Pinto, Shweta Sankhe-Savale, JC Gillet, and Kenneth Michael Cherven

Reviewers: Siddharth Pawar and Murari Ramuka

Development Editor: Aditi Hinge

Acquisitions Editor: Sneha Shinde

Production Editor: Salma Patel

Editorial Board: Megan Carlisle, Heather Gopsill, Bridget Kenningham, Manasa Kumar, Alex Mazonowicz, Monesh Mirpuri, Abhishek Rane, Brendan Rodrigues, Ankita Thakur, Nitesh Thakur, and Jonathan Wray

First published: April 2022

Production reference: 1250422

ISBN: 978-1-80020-765-3

Published by Packt Publishing Ltd.

Livery Place, 35 Livery Street

Birmingham B3 2PB, UK

Table of Contents

Preface

1. Introduction: Visual Analytics with Tableau

Introduction

The Importance of Visual Analytics

The Tableau Product Suite

Introduction to Tableau Desktop

Exercise 1.01: Connecting to a Data Source

Exercise 1.02: Creating a Comparison Chart Using Manual Drag and Drop

Exercise 1.03: Creating a Comparison Chart Using the Automated Show Me Button Method

Data Visualization Using Tableau Desktop

Saving and Sharing Your Work

Exercise 1.04: Saving Your Work as a Static Snapshot-PowerPoint Export

Exercise 1.05: Saving Your Work as a Tableau Interactive File–Tableau Packaged Workbook

Activity 1.01: Identifying and Creating the Appropriate Chart to Find Outliers in Your Data

Summary

2. Data Preparation: Using Tableau Desktop

Introduction

Connecting to a Data Source

Exercise 2.01: Connecting to an Excel File

Connecting to a Server Data Source

Various Joins in Tableau

Different Types of Joins

Exercise 2.02: Creating an Inner Join Dataset

Exercise 2.03: Creating a Left Join Dataset

Exercise 2.04: Creating a Right Join Dataset

Exercise 2.05: Creating a Combined Dataset Using Union

Data Transformation in the Data Pane

Data Interpreter

Renaming the Data Source

Live and Extract Connections

Exercise 2.06: Creating an Extract for Data

Extract Properties

The Data Storage field

The Filters field

The Aggregation Field

The Number of Rows Field

Which Connection Is Better – Live or Extract?

Filters

Exercise 2.07: Adding a Region Filter on the Orders Table

Data Grid Options

Custom SQL

Data Blending

Exercise 2.08: Creating a Data Blend Using the Orders and People Tables

Exercise 2.09: Visualizing Data Created from a Data Blend

Limitations of Data Blending

Activity 2.01: Identifying the Returned Orders

Activity 2.02: Preparing Data for Visualization

Summary

3. Data Preparation: Using Tableau Prep

Introduction

Prep Interface

Adding Data in the Flow

Exercise 3.01: Connecting to an Excel File

Exercise 3.02: Connecting with Multiple Data Sources

Data Source Profile

Exercise 3.03: Data Profile for the Orders_South Dataset

Data Preparation Using Clean, Groups, and Split

Additional Clean Steps

Cleaning Steps at the Column Level

Exercise 3.04: Applying a Filter in a Clean Step

Exercise 3.05: Cleaning a Column in the Workflow

Grouping Values

Exercise 3.06: Grouping Values into a Group

Splitting Values

Exercise 3.07: Splitting Columns

Aggregation, Pivot, Join, and Union

Aggregations

Exercise 3.08: Identifying High-Value Customers Based on Purchases

Pivoting Data

Exercise 3.09: Using a Pivot for Data

Joining and Union of Data

Exercise 3.10: Joining Two Data Sources

Union

Exercise 3.11: Union of Tables

Script Step

Flow and Data Exports

Exercise 3.12: Exporting Data

Activity 3.01: Finding the Month with the Highest Orders

Activity 3.02: Data Transformation

Summary

4. Data Exploration: Comparison and Composition

Introduction

Exploring Comparisons across Dimensional Items

Bar Chart

Exercise 4.01: Creating Bar Charts

Exploring Comparisons over Time

Exercise 4.02: Creating Bar Charts for Data over Time

Line Charts

Difference between Discrete Dates and Continuous Dates

Exercise 4.03: Creating Line Charts over Time

Exploring Comparison across Measures

Exercise 4.04: Creating a Bullet Chart

Bar-in-Bar Charts

Exercise 4.05: Creating a Bar-in-Bar Chart

Exploring Composition Snapshots – Stacked Bar Charts

Exercise 4.06: Creating a Stacked Bar Chart

Exploring Composition Snapshots – Pie Charts

Exercise 4.07: Creating a Pie Chart

Treemaps

Exercise 4.08: Creating Treemaps

Exploring Compositions for Trended Data

Area Charts

Exercise 4.09: Creating an Area Chart

Activity 4.01: Visualizing the Growth of Passenger Cars in Singapore

Summary

5. Data Exploration: Distributions and Relationships

Introduction

Exploring Distribution for a Single Measure

Creating a Histogram

Exercise 5.01: Creating a Histogram

Box and Whisker Plots

Exercise 5.02: Creating a Box and Whisker Plot without the Show Me Panel

Exercise 5.03: Box Plot Using the Show Me Panel

Relationship and Distribution with Multiple Measures

Distribution with Two Measures

Creating a Scatter Plot

Exercise 5.04: Creating a Scatter Plot

Scatter Plots with Trend Lines

Exercise 5.05: Trend Lines with Scatter Plots

Trend Lines and Types

Linear Trend Lines

Polynomial Trend Lines

Polynomial Degree of Freedom

Logarithmic Trend Lines

Exponential Trend Lines

Power Trend Lines

The Reliability of Trend Lines

R-Squared

P-value

Advanced Charts

Quadrant Charts

Reference Lines

Understanding Reference Lines

Exercise 5.06: Creating Quadrant Charts

Combination Charts – Dual axis Charts

Exercise 5.07: Creating Dual axis Charts

Activity 5.01: Creating Scatter Plots

Activity 5.02: Dual axis Chart with Asynchronous Axes

Summary

6. Data Exploration: Exploring Geographical Data

Introduction

Importing Spatial Data

Data File Types

ESRI Shapefiles

GeoJSON Files

KML Files

MapInfo Interchange Format

MapInfo Tables

TopoJSON Files

Downloading the Data Source from GitHub

Exercise 6.01: Downloading the Source Data

Importing Non-Spatial Geographic Data Sources

Exercise 6.02: Importing a Non-Spatial Data Source

Data Relationships

Exercise 6.03: Joining Two Data Sources

Managing Location Data

Assigning Geographic Roles

Editing Locations

Building Custom Geographies

Creating a New Geography Using an Existing Role

Creating a New Geography Using Groups

Exercise 6.04: Building Custom Geographies

Creating Maps in Tableau

Geocoding

Symbol Maps

Adding Data to Symbol Maps

Coloring a Symbol Map

Sizing a Symbol Map

Using Shapes in a Symbol Map

Adding Map Tooltips

Navigating Symbol Maps

Filtering Symbol Maps

Creating Groups and Sets from Symbol Map Data

Exercise 6.05: Building a Symbol Map

Choropleth (Filled) Maps

Coloring a Choropleth Map

Navigating a Choropleth Map

Filtering a Choropleth Map

Exercise 6.06: Building a Choropleth Map

Dual-Axis Maps

Exercise 6.07: Creating a Dual-Axis Map

Map Enhancements

Setting Map Options

Using Existing Layers

Adding Mapbox Background Maps

Exercise 6.08: Adding Mapbox Background Maps

Activity 6.01: Creating a Location Analysis Using Dual Axis and Background Maps

Summary

7. Data Analysis: Creating and Using Calculations

Introduction

Creating and Using Ad hoc / Edit in Shelf Calculations

Exercise 7.01: Creating an Ad Hoc Calculation to Highlight Loss-Making Sub-Categories

Creating and Using Different Types of Calculations

Creating and Using Different Types of Calculations: Numeric Calculations

Exercise 7.02: Creating a Numeric Calculation

Creating and Using Different Types of Calculations: Logic Statements

Exercise 7.03: Creating a Logic Calculation

Creating and Using Different Types of Calculations: String Calculations

Exercise 7.04: Creating a String Calculation

Creating and Using Different Types of Calculations: Date Calculations

Exercise 7.05: Creating a Date Calculation

Handling Null Values while Creating and Using Calculations

Creating Calculations across Data Sources

Activity 7.01: Calculating the Profit Margin

Activity 7.02: Calculating the Percentage Achievement with Respect to Budget Sales

Summary

8. Data Analysis: Creating and Using Table Calculations

Introduction

Quick Table Calculations

Running Total

Exercise 8.01: Creating a Running Total Calculation

Difference

Exercise 8.02: Creating a Difference Calculation

Percent of Total

Exercise 8.03: Creating a Percent of Total Calculation

Percent Difference

Exercise 8.04: Creating a Percent Difference Calculation

Percentile and Rank

Exercise 8.05: Creating Percentile and Rank Calculations

Moving Average

Exercise 8.06: Creating a Moving Average Calculation

Table Calculation Application: Addressing and Partitioning

Table (across)

Exercise 8.07: Creating a Table (across) Calculation

Table (down)

Exercise 8.08: Creating a Table (down) Calculation

Exercise 8.09: Creating Table (across then down) and Table (down then across) Calculations

Exercise 8.10: Creating a Pane (across) Calculation

Exercise 8.11: Pane (down) Calculation

Exercise 8.12: Creating a Pane-Level Calculation

Cell

Creating, Editing, and Removing Table Calculations

Creating a New Table Calculation

Exercise 8.13: Creating a Table Calculation Using the Calculation Editor

Removing a Table Calculation

Activity 8.01: Managing Hospital Bed Allocations

Activity 8.02: Planning for a Healthy Population

Summary

9. Data Analysis: Creating and Using Level of Details (LOD) Calculations

Introduction

Exercise 9.01: Creating a LOD Calculation

Types of LOD Calculations

FIXED

Exercise 9.02: Creating a FIXED LOD Calculation

INCLUDE

Exercise 9.03: Creating an INCLUDE LOD Calculation

EXCLUDE

Exercise 9.04: Creating an EXCLUDE LOD Calculation

Table-Scoped

LOD Calculations: Dimensions or Measures?

Aggregation and LOD Calculations

LOD Calculation Is Higher than the View LOD

LOD Calculation Is Finer than the View LOD

Nested LOD Calculations

Effects of Filters on LOD Calculations

Activity 9.01: Identifying the Top-Performing Sales Executives

Activity 9.02: Performing a Comparative Analysis

Summary

10. Dashboards and Storyboards

Introduction

The Who, What, and Why of the Dashboard

The Who: Audience

The What: Begin with the End in Mind

The Why: The Need for a Dashboard

Designing a Dashboard

The Basic Layout

Display Size

Positioning

Spacing

Colors

Size

Text

Exercise 10.01: Text Formatting – Workbook versus Worksheet

Dashboard Objects

Vertical Objects

Horizontal Objects

Text Objects

Image Objects

Web Page Objects

Blank Objects

Navigation Objects

Extension Object

Using Floating Objects

Exercise 10.02: KPIs and Metrics View

Exercise 10.03: Map and Parameter Worksheet Views

Exercise 10.04: Putting It All Together: Dashboarding

Creating Storyboards

Exercise 10.05: Creating a Simple Storyboard

Activity 10.01: Building a Complete Dashboard

Summary

11. Tableau Interactivity: Part 1

Introduction

Grouping Data

Exercise 11.01: Creating Groups

Hierarchies

Exercise 11.02: Creating Hierarchies

Filters: The Heart and Soul of Tableau

Data Source and Extract Filters

Exercise 11.03: Filtering Data Using Extract/Data Source Filters

Filters Using Views

Exercise 11.04: Creating Filters from the View

Creating Filters Using the Filters Shelf

Dimension Filters Using the Filters Shelf

Exercise 11.05: Dimension Filters Using the Filters Shelf

Measure Filters Using the Filters Shelf

Exercise 11.06: Measuring Filters Using the Filters Shelf

Date Filters Using the Filters Shelf

Exercise 11.07: Creating Date Filters Using the Filters Shelf

Quick Filters

Exercise 11.8: Creating Quick Filters

Applying Filters across Multiple Sheets/Multiple Data Sources or an Entire Data Source

Context Filters

Exercise 11.09: Creating and Using Context Filters

Sets

Static Sets

Exercise 11.10: Creating Static Sets

Dynamic Sets

Exercise 11.11: Creating Dynamic Sets

Adding Members to the Set

Exercise 11.12: Adding Members to the Set

Combined Sets

Exercise 11.13: How to Create Combined Sets

Parameters

Exercise 11.14: Standard Parameters

Dynamic Parameters

Exercise 11.15: Dynamic Parameters

Activity 11.01: Top N Countries Using Parameters, Sets, and Filters

Summary

Preface

About the Book

Learning Tableau has never been easier, thanks to this practical introduction to storytelling with data. The Tableau Workshop breaks down the analytical process into five steps: data preparation, data exploration, data analysis, interactivity, and distribution of dashboards. Each stage is addressed with a clear walk-through of the key tools and techniques you'll need, as well as engaging real-world examples, meaningful data, and practical exercises to give you valuable hands-on experience.

As you work through the book, you'll learn Tableau step by step, studying how to clean, shape, and combine data, as well as how to choose the most suitable charts for any given scenario. You'll load data from various sources and formats, perform data engineering to create new data that delivers deeper insights, and create interactive dashboards that engage end users.

All concepts are introduced with clear, simple explanations and demonstrated through realistic example scenarios. You'll simulate real-world data science projects with use cases such as traffic violations, urban populations, coffee store sales, and air travel delays.

By the end of this Tableau book, you'll have the skills and knowledge to confidently present analytical results and make data-driven decisions.

About the Authors

Sumit Gupta is an analytics professional with more than 7 years' experience spanning across marketing, sales, and product analytics. As a consultant and trainer, he has utilized Tableau to build better data-driven teams for his organization. Sumit specializes in translating vast amounts of data into easy-to-understand dashboards which provide actionable intelligence. He is a Tableau Certified Associate and enjoys training data enthusiasts to become better Tableau developers and certified Tableau associates. This book is one such effort to reach masses.

I would like to thank my family for being incredibly supportive through this book-writing journey, especially my super-mom. Without her, I wouldn’t be where I am today. I would also like to thank my friends (Piyush and Sheshnath, to name a few) and mentors/leaders/managers who have also pushed me to become better every day. Onwards and Upwards!

Sylvester Pinto has been using Tableau for almost a decade now for improving business performance for different industries. Sylvester has designed various business solutions using Tableau for different organizations leading to a huge impact to improve their businesses. He has a Tableau certification and as a consultant designs solutions for various organizations.

Shweta Sankhe-Savale is the co-founder and Head of Client Engagements at Syvylyze Analytics (pronounced "civilize"), a boutique business analytics firm specializing in visual analytics. Shweta is a Tableau Desktop Qualified Associate and a Tableau Accredited Trainer. Being one of the leading experts on Tableau in India, Shweta has translated her experience and expertise into successfully rendering analytics and data visualization services for numerous clients across a wide range of industry verticals. She has taken on numerous training and consulting assignments for customers across sectors such as BFSI, FMCG, retail, e-commerce, consulting and professional services, manufacturing, healthcare and pharma, ITeS, and more. She even had the privilege of working with renowned government and UN agencies. Combining her ability to break down complex concepts with her expertise on Tableau's visual analytics platforms, Shweta has successfully trained over 1,300 participants from 85+ companies.

Jean-Charles (JC) Gillet is a seasoned business analyst with over 7 years of experience with SQL at both a large-scale multinational company in the United Kingdom and a smaller firm in the United States, and 5 years of Tableau experience. He has been working with Tableau and SQL for multiple years to share his expertise with his colleagues, as well as delivering SQL training. A French national, JC holds a master's degree in executive engineering from Mines ParisTech and is a Tableau Desktop Certified Associate.

In his free time, he enjoys spending time with his wife and daughter (to whom he dedicates his work on this book) and playing team handball, having competed in national championships.

I'd like dedicate this work first and foremost to my wife and two children, who stand by my side every day, through thick and thin. But also to my parents, who taught me my core values, and my managers, especially my mentors and friends Robert and Miguel, who have meant so much to me.

Kenneth Michael Cherven is a Data Analyst and Visualizer based in Detroit, Michigan, USA. He has worked with Tableau for more than 15 years with a focus on making complex data easily understood through the of interactive dashboards and creative displays. Beyond his work in the automotive sector, Kenneth analyzes data and creates visualizations using open data sources from the baseball, government, music, and craft beer domains. Ken has previously published two titles for Packt – Network Graph Analysis and Visualization with Gephi and Mastering Gephi Network Visualization.

Who This Book Is For

This book is for anyone who wants to get started on visual analytics with Tableau. If you're new to Tableau, this Workshop will get you up and running. If you already have some experience in Tableau, this book will help fill in any gaps, consolidate your understanding, and give you extra practice with the key tools.

About the Chapters

Chapter 1, Introduction: Visual Analytics with Tableau, teaches you the basic skills needed to understand data and its visual elements for reporting and creating dashboards.

Chapter 2, Data Preparation: Using Tableau Desktop, covers the essential skills you need to create reports in Tableau, such as loading, joining, transforming, blending, and manipulating data.

Chapter 3, Data Preparation: Using Tableau Prep, covers Tableau Prep and how Prep helps in cleaning and joining disparate data sources. You will learn how to perform data manipulation methods such as pivots, grouping, and aggregations, and finally, how to export the transformed data into Tableau.

Chapter 4, Data Exploration: Comparison and Composition, expands on your Tableau knowledge. You will start creating charts in Tableau, including line, bar, and stacked area charts. You will also learn how to create trend reports.

Chapter 5, Data Exploration: Distributions and Relationships, covers reference lines and advanced chart types such as Dual Axis and Quadrant charts.

Chapter 6, Data Exploration: Exploring Geographical Data, teaches you how to explore geographical data to perform location-based analysis in Tableau.

Chapter 7, Data Analysis: Creating and Using Calculations, covers calculations, including numeric, string, and date calculations. You will also learn how to write logical statements in calculated fields.

Chapter 8, Data Analysis: Creating and Using Table Calculations, touches on table calculations and how they differ from calculated fields, and when to use table calculations versus calculated fields.

Chapter 9, Data Analysis: Creating and Using Level of Details (LOD) Calculations, covers LOD calculations, with which you will learn how to control the aggregation level in your view.

Chapter 10, Dashboards and Storyboards, covers the basics of using a blank canvas to build interactive dashboards, including adding branding elements, filters, and web pages. Finally, we will also cover storyboards and how they differ from dashboards.

Chapter 11, Tableau Interactivity: Part 1, dives deeper into Tableau Order of Operations, Filters, Sets, and Parameters, while reinforcing the other charting and dashboarding skills.

This is part one of a two-part topic, the latter half of which is available online.

Note

There are also three bonus chapters (Chapter 12, Tableau Interactivity: Part 2; Chapter 13, Distribution of Dashboards; and Chapter 14, Case Study) which you can find at https://packt.link/SHQ4H.

You can also find solutions for all activities in this Workshop online at https://packt.link/CTCxk.

Conventions

Code words in text form, database and collection names, file and folder names, shell commands, and user input use the following format: "There are also other File, Edit, Flow, and Server menu options at the top. The purposes of the File and Edit options are self-explanatory. The Flow menu can be used to run the flow and the Server menu has the option to sign in and publish the flow on Tableau Server." 

Often at the beginning of chapters, key new terms will be introduced. In these cases, the following formatting will be used: "Understanding aggregations is the most fundamental concept you need to keep in mind when working with Tableau." 

Minimum Hardware Requirements

For an optimal experience, we recommend the following hardware configuration:

Processor: Dual core or betterMemory: 4 GB RAMStorage: 10 GB available space

Minimum Software Requirements

Unlike hardware requirements, software requirements can be challenging to list because Tableau releases new updates to their software every 3-6 months and there are new features added with these new releases. But considering the exercises/activities planned in this book, we expect the following to be required at minimum:

Tableau Desktop 2020.1 or aboveTableau Prep 2020.1 or above

This book was written and reviewed using Tableau versions 2020.1.x. Though new versions of Tableau are frequently released, the steps used for the exercises and activities in this book are unlikely to change with the version changes. Any known differences at the time of publication will be noted within the text as relevant.

Downloading the Book/Data Sources Bundle

GitHub link: https://packt.link/jqzD0

Download all the folders and data files from GitHub (as shown) or download individual chapter files separately as needed.

Figure 0.1: GitHub files

Setting Up Your Environment

Before you begin the book, you need to set up both Tableau Desktop and Tableau Prep. In this section, you will see how to install Tableau Desktop. Once you have followed these steps and installed Tableau Desktop, you will also then need to follow the same steps to download Tableau Prep. The download links are as follows:

Tableau Desktop 2020.1: https://www.tableau.com/support/releases

Tableau Prep 2020.1: https://www.tableau.com/support/releases/prep

Installing Tableau on Your System

From https://www.tableau.com/support/releases/, click on 2020.1 to expand the list. Click on any of the 2020.1.XX links as follows:

Figure 0.2: Tableau downloads/release notes page

Click on 2020.1.20 and on the new page which was loaded. Next, either click on Download Tableau Desktop 2020.1.20 and Tableau will automatically detect your operating system, or else scroll down to the Download Files section and click on the appropriate download link for your operating system (Windows or Mac).

Figure 0.3: Tableau download 2020.1.20 page

Once you have downloaded the file, open your downloads folder, and double-click on the downloaded file. You will see the following screen if you are using a Mac (Windows will have a similar workflow):

Figure 0.4: Tableau Desktop installer: introduction

Follow the prompt by clicking on Continue and agreeing to the terms and conditions of the software license agreement:

Figure 0.5: Tableau software agreement prompt

It might take a minute or two to install the software and you may be asked to restart your system, depending on your computer's configuration.

Once the files are written, you should see the following success message. Click on Close to finish the installation:

Figure 0.6: Tableau installation complete

To verify whether the software was installed, if you are using Mac, press cmd + Space to open spotlight search and type in Tableau. You should see the following on your screen. Similarly, if you are using Windows, click on the Windows button and type Tableau to open the application.

Figure 0.7: Searching Tableau in spotlight search

You can follow the same steps to install Tableau Prep by downloading the software from the download link above. When you load either Tableau Desktop or Tableau Prep for the first time, you might be required to register the software and enter the license key. Depending on your situation, either your organization might be able to provide the license keys, or you can start a 14-day trial to explore the software. Finally, if you are a student or teacher, Tableau offers free 1-year licenses; to learn more, visit https://www.tableau.com/academic/students.

Get in Touch

Feedback from our readers is always welcome.

General feedback: If you have any questions about this book, please mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you could report this to us. Please visit www.packtpub.com/support/errata and complete the form.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you could provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Please Leave a Review

Let us know what you think by leaving a detailed, impartial review on Amazon. We appreciate all feedback – it helps us continue to make great products and help aspiring developers build their skills. Please spare a few minutes to give your thoughts – it makes a big difference to us. You can leave a review by clicking the following link: https://packt.link/r/1800207654.

1. Introduction: Visual Analytics with Tableau

Overview

In this chapter, you will learn about Visual Analytics and why it is important to visualize your data. You will connect to data using Tableau Desktop and familiarize yourself with the Tableau workspace. By the end of this chapter, you will be well acquainted with the Tableau interface and some of the fundamental important concepts that will help you get started with Tableau. The topics that are covered in this chapter will mark the start of your Tableau journey.

Introduction

At a very broad level, the whole data analytics process can be broken down into the following steps: data preparation, data exploration, data analysis, and distribution. This process typically starts with a question or a goal, which is followed by finding and getting the relevant data. Once the relevant data is available, you then need to prepare this data for your exploration and analysis stage. You might have to clean and restructure the data to get it in the right form, maybe combine it with some additional datasets, or enhance the data by creating some calculations. This stage is referred to as the data preparation stage. After this comes the data exploration stage. It is at this stage that you try to see the composition and distribution of your data, compare data, and identify relationships if any exist. This step gives an idea of what kind of analysis can be done with the given dataset.

Typically, people like to explore the data by looking at it in its raw form (that is, at the data preparation stage); however, a quick and easy way to explore the data is to visualize it. Visualizing the data can reveal patterns that were difficult to recognize in the raw data.

The data exploration stage is followed by the data analysis stage, in which you analyze your data and develop insights that can be shared with others. These insights, when visualized, will enable easier interpretation of data, which in turn leads to better decision making. In very simplistic terms, the process of exploring and analyzing the data by visualizing it as charts and graphs is called "visual analytics." As mentioned earlier, the idea behind visualizing your data is to enable faster decision making. Finally, the last step in the data analytics cycle is the distribution stage, wherein you share your work with other stakeholders who can consume this information and act upon it.

In this chapter, we will discuss all these topics in detail, starting with a further exploration of the value of the titular process.

The Importance of Visual Analytics

As mentioned earlier, "Visual Analytics" can be defined as the process of exploring and analyzing data by visualizing it as charts and graphs. This enables end users to quickly consume the information and, in turn, empowers them to make quicker and better decisions.

In this section, you will learn why data visualization is a better tool for evaluation than looking at large volumes of data in numeric format.

All of us have at some point heard the expression "A picture is worth a thousand words." Indeed, it has been found that humans are great at identifying and recognizing patterns and trends in data when consumed as visuals as opposed to large volumes of data in tabular or spreadsheet formats.

To understand the importance and the power of data visualization/visual analytics, let's look at one of the classic examples: Anscombe's Quartet. Anscombe's quartet is comprised of four distinct datasets with nearly identical statistical properties, yet completely different distributions and visualizations.

Note

This was developed in 1973 by an English statistician named Francis John (Frank) Anscombe, after whom it was named.

Let's take a deeper look at these datasets.

Figure 1.1: A screenshot showing the datasets used in Anscombe's quartet

As you can see in the preceding figure, each dataset consists of 11 X and Y points. Now, if you were to analyze these datasets using typical descriptive statistics such as mean, standard deviation, and correlation between X and Y, you would see that the output is identical.

Figure 1.2: A screenshot showing descriptive statistics of the Anscombe's quartet data

Looking at the preceding figure, you can see the following:

The mean of X for each dataset is 9 (exact accuracy).The standard deviation for X for each dataset is 3.32 (exact accuracy).The mean of Y for each dataset is 7.50 (accurate up to two decimals).The standard deviation for Y for each dataset is 2.03 (accurate up to two decimals).The correlation between X and Y for each dataset is 0.816 (accurate up to three decimals).

So, by looking at the above statistical inferences, you would assume that these datasets are identical until you decide to visualize each of them, the results of which are displayed below.

The images show how these datasets appear when visualized as graphs. Now, let's compare each of these visualizations side by side so that you can see how different each of these datasets really are.

Figure 1.3: A screenshot showing a graphical representation of all four datasets of Anscombe's quartet

The preceding example highlights how data visualization can help uncover patterns in data that it was not possible to see by simply looking at the numbers and/or just analyzing the data statistically. This is exactly why Francis Anscombe created his "quartet." He wanted to counter the argument that "numerical calculations are exact, but graphs are rough," which, back then, was a quite common impression among statisticians.

Next, take a look at one more example of how visualizing data helps us find quick insights. Refer to the following figure:

Figure 1.4: A screenshot of a grid view showing the marketing expense and profitability for products across markets

In the preceding figure, you can see a grid view of fields such as Product Type, Product, Market, Marketing, and Profit. In the data that you have used, Marketing is the money that is spent on any marketing efforts to promote products, and Profit is the profit generated after those marketing efforts. Further, these values are broken down by dimensions such as Product Type, Product, and Market. The idea is to evaluate how each product is doing in terms of Marketing and Profit across different markets.

Now, displaying this information in a grid format, as shown above, results in 84 numbers being shown in the view, and doing any kind of comparison across these 84 numbers is going to be very difficult. So, imagine you want to find out whether there are any products in any specific markets where losses are made even after spending significant money on the marketing efforts. Then you will end up comparing these numbers horizontally as well as vertically, which, honestly, is a bit tedious. However, let's see whether visualizing this data makes any difference. Refer to the following figure:

Figure 1.5: A bar chart comparing the marketing expense and profitability for products

In the preceding figure, you can see that the length of the bar is the money spent on Marketing, whereas the color of the bar represents the Profit value. So basically, the longer the bar, the more money was spent on marketing; the darker the shade of blue, the more profitable the product; and the darker the shade of orange, the greater the loss accrued.

Looking back at that figure, note that the longest bar is Caffe Mocha in the East market. This means that Caffe Mocha has the highest marketing spending, but because the color of that bar is orange, you also know that it is accruing a loss.

This is another example that demonstrates the power of data visualization.

Now that you have understood what visual analytics is and why it is important, let's look at some data visualization tools in the next section.

The Tableau Product Suite

There are a lot of tools available on the market offering various features and functionalities that you can use to visualize your data. When it comes to business analytics and data visualization, Tableau is one of the leading tools in this space because of its ease of use and drag and drop functionality, which makes it easier even for a business user to start making sense of their data. Tableau has different tools for different purposes, available in the Tableau product suite, which we'll explore in this section.

The entire suite can be divided into three parts: data preparation, data visualization, and consumption or distribution. Refer to the following figure:

Figure 1.6: A screenshot showing the Tableau product suite

As shown in the preceding figure, you have Tableau Prep in the Data Preparation layer, which is used for cleaning, combining, reshaping, and enhancing your data. This tool helps get your data ready for analysis and visualization.

Now, once your data is ready and is in the right form and structure, you will start analyzing and visualizing it. For this purpose, you will use either Tableau Desktop or Tableau Public.

Tableau Desktop is where you create your visualizations, analytics, and dashboards. This is typically the tool you would spend your time on as most of your development is done using Tableau Desktop. Tableau Public can also be used for creating your analytics and visualizations. However, the catch here is that you cannot save your work locally or offline, and it will necessarily be saved to a Tableau Public server, which can be viewed by anybody. Tableau Public is a free version that is like Tableau Desktop and is typically used by bloggers, journalists, researchers, and so on who deal with public or open data.

Tableau Public is a great tool for anyone wanting to build visualizations for public consumption but is not recommended for anyone working with confidential data. When dealing with confidential data, it is best to use Tableau Desktop.

Once you are done building your visualizations, you can share your work with others using an online methodology with Tableau Server or Tableau Online or share an offline copy of your work, which can then be opened using Tableau Reader.

Tableau Server is an on-premises hosted browser and mobile-based collaboration platform used to publish dashboards created in Tableau Desktop and share them with your end users. It allows you to share and, to some extent, edit and publish dashboards, while also managing access rights and making your visualizations accessible securely over the web. It allows you to refresh your dashboards at a scheduled frequency and maintain live data connectivity to the backend data sources, which in turn allows users to consume the up-to-date dashboards online from anywhere. Tableau Server also allows you to view your dashboards on a mobile tablet through an app available on both iOS and Android. Tableau Online, on the other hand, is a cloud-hosted version (or SaaS version) of Tableau Server. It brings the server capabilities of the cloud without the infrastructure cost.

However, if you want to consume dashboards offline, you can use Tableau Reader. This is a free desktop application that can be used to open, view, and interact with dashboards and visualizations built in Tableau Desktop. So basically, it allows you to filter, drill down, view the details of data, and interact with dashboards to the full extent of what the author has intended. That said, being a reader, you cannot make any changes or edit the dashboard in any way beyond what has already been built in by the author.

The upcoming section, as well as the following chapters, will focus on Tableau Desktop. You will be familiarizing yourself with the interface of Tableau Desktop, to understand its workspace and see how you can create your visualizations and build your dashboards.

The point to note here is that Tableau Desktop is a licensed product and if you don't have the necessary license, then you can even use Tableau Public to try out the examples covered in the book. As mentioned earlier, Tableau Desktop and Tableau Public are the two main developer products offered by Tableau and the only difference between these two products is the range of data source connectivity offered, the ability to save files locally, and the security of your work. While Tableau Desktop offers all this, Tableau Public has limitations.

However, the rest of the functionalities and the look and feel of both these tools is the same. The next section explores how to use Tableau to connect, analyze, and visualize your data.

Please note that we are using a licensed version of Tableau Desktop in this book.

Introduction to Tableau Desktop

Now, that you have identified and chosen Tableau Desktop for the creation of your visuals and dashboards, let's dive deeper into the product, its interface, and its functionality. So, once you have downloaded and installed the product, you will be able to use the products to connect to your data and start building your visualizations.

The landing page of Tableau Desktop is shown in the following screenshot:

Figure 1.7: A screenshot of the Tableau Desktop landing page

Review the following list for explanations of the highlighted sections in the screenshot:

Connect: The list of data sources you can connect to. You can connect to data residing on Tableau Server (the Search for Data option); to flat files, such as Excel and CSVs (the To a File option); or to databases (the To a Server option). Tableau has native in-built connectors for a lot of the data sources, which makes the interaction with data from these data sources seamless. The list is quite extensive, and it keeps on growing. Note though that while Tableau Desktop provides an extensive list of data connectors, Tableau Public only allows you to connect to flat files (the To a File option). Refer to the following screenshot to see the More… option of Tableau Desktop 2020.1 version:

Figure 1.8: A screenshot showing the extensive list of data sources that Tableau Desktop can connect to

Saved Data Sources: While the top section allows you to connect to raw data sources, the Saved Data Sources option lets you connect to data sources that have been previously worked on and/or modified and then saved for later use. Open: This section shows the thumbnails of the recently accessed Tableau files. This section is blank to begin with, but as you create and save new workbooks, it will keep on updating and will display the thumbnails of the most recently opened workbooks. This section can also be used to pin your favorite workbooks. Sample Workbooks: This section shows some of the sample work already done in Tableau. Selecting any of the thumbnails here will open the relevant Tableau workbook. A quick point to note here is that a "workbook" in Tableau is a file that consists of multiple worksheets and/or dashboards and/or storyboards.Discover: This section contains some shortcut links to the training videos and resources on the Tableau website.Now that you are familiar with the landing page of Tableau, let's move on and see how to connect to data in the following exercise.

Exercise 1.01: Connecting to a Data Source

In this exercise, you will connect to a data source for the first time, which is the very first step when analyzing data in Tableau.

There are many types of data sources that you can connect to, but for the purposes of this exercise, you will work with an Excel file—in this case, Sample-Superstore.xls, which comes in-built with Tableau and contains sales and profit data for a company.

Perform the following steps to complete the exercise:

Select the Microsoft Excel option from the To a File option under Connect on the left-hand side of the landing page. You should see the following screen:

Figure 1.9: A screenshot showing the Connect to Microsoft Excel option

Once you have selected this option, it will ask you to browse the Excel file that you wish to connect to. To do this, connect to Sample-Superstore.xls, which can be found in Documents>My Tableau Repository>Datasources, or can also be downloaded from the GitHub repository for this chapter, at https://packt.link/7hnNH. Refer to the following screenshot:

Figure 1.10: A screenshot showing the Sample - Superstore.xls data under My Tableau Repository

This data is the sample dataset that comes along with the product. Once you have downloaded and installed Tableau Desktop, you will notice the My Tableau Repository folder being created under your Documents folder. This is where you will find this sample dataset.

Once you have connected to this data source, you will see the data connection page of Tableau Desktop, as shown in the following screenshot. Review the following notes to better understand what you're looking at:

Figure 1.11: A screenshot showing the data connection page in Tableau Desktop

Section 1: This highlights the data source that you have connected to. This is the Sample - Superstore.xls file that you just established a connection with. One point to note here is that just because you have established a connection to this Excel file does not mean that you have connected to the data.Section 2: These are the tables/worksheets in your Sample - Superstore.xls file, which is where the actual data resides. The Orders table contains the list of all transactions from this retail superstore and contains data at an order level. This order level contains details of the day, product, and customer levels. Refer to the following figure to take a glance at the Orders table:

Figure 1.12: A screenshot showing a glimpse into the Orders worksheet of Sample - Superstore.xls

The People table contains just two columns: Region and Person. The Person column is the list of managers for each Region. Refer to the following screenshot to take a glance at the People table:

Figure 1.13: A screenshot showing a glimpse into the People worksheet of Sample - Superstore.xls

The Returns table contains the list of all the transactions/orders that were returned. So, again, only two columns: Returned and Order ID. Refer to the following screenshot to take a glance at the Returns table:

Figure 1.14: A screenshot showing a glimpse into the Returns worksheet of Sample - Superstore.xls

Section 3: This is the list of Named Ranges that were created on the aforementioned tables/ worksheets (that is, Orders, People, and Returns) of the Sample - Superstore.xls data source. Named Ranges are a feature in Microsoft Excel, and Tableau gives you the option of reading data from these predefined Named Ranges. To understand more about these Named Ranges in Excel, please refer to the following link: https://support.microsoft.com/en-us/office/define-and-use-names-in-formulas-4d0f13ac-53b7-422e-afd2-abd7ff379c64?ui=en-us&rs=en-us&ad=us.So, at this point, you have made a connection to the Sample - Superstore.xls file; however, you are yet to establish a connection to the data to be able to read it in Tableau for your analysis. To do so, drag the Orders worksheet from the left-hand side list and drop it into the top blank section, which reads Drag sheets here. (If you are working with a version later than 2020.1, this may instead read Drag tables here.) Please note that you need to use the Orders worksheet and not the Orders named range since the data in the named range could be limited compared to the data in the Orders worksheet. Refer to the following screenshot:

Figure 1.15: A screenshot showing how to read data from the Orders worksheet of Sample - Superstore.xls

Once you drag and drop the Orders worksheet into the Drag sheets here section, you will see the view update for you, as shown in the following screenshot:

Figure 1.16: A screenshot showing the view after dragging and dropping the Orders worksheet

The preceding figure shows the view after fetching the Orders worksheet into the Drag sheets here section. Review the highlighted sections in the screenshot and the corresponding notes below to understand more.

Section 1: This is the preview section where you get to see a quick preview (about 1,000 rows) of your Orders data. This is where you can quickly take stock of your data and make sure you have all the necessary columns to work with.Section 2: This is the Connection option. It has two options to choose from, Live and Extract. A Live connection is the option that you use when you want to connect to data in real time. This means that basically any changes at the data end will be reflected in Tableau. However, a quick point to note here is that the Live connection option relies on the data sources to process all the queries, and this could lead to performance issues in Tableau if the backend data source is a slow-performing data source. The Extract connection, on the other hand, is a snapshot of your data stored in a Tableau propriety format called Tableau Data Extract, which uses the file extension .hyper. Since the .hyper file only has a snapshot of the data, it will have to be refreshed if you need to see and use the updated data. Section 3: This is the Filters option, which is used to limit the amount of data that is read and used in Tableau. This works for both the Live and Extract options mentioned earlier.

Now that you understand the data connection page of Tableau, you can finally start using Tableau to analyze and visualize your data.

Connect Live to your Orders data from Sample - Superstore.xls. Refer to the following screenshot:

Figure 1.17: A screenshot showing the Go to Worksheet option

Now, the final step for fetching the data for your analysis is to click on Sheet1, and from there, select Go to Worksheet. With this, you will have read the data into Tableau Desktop and will now be able to start using it. Refer to the following screenshot:

Figure 1.18: A screenshot showing the workspace of Tableau

The preceding screenshot shows the Tableau workspace. This is the space in which you will create your visualizations going forward. Let's quickly go through the highlighted sections in the screenshot to understand the workspace in more detail.

Section 1: This is the workbook name. As mentioned previously, a workbook in Tableau is a file that consists of multiple worksheets and/or dashboards and/or storyboards. By default, it is named Book1 (as shown in the image). However, you can assign any new name you like when you save the workbook.Section 2: This is the toolbar section, and this consists of various options that help you explore the various features and functionalities available in Tableau.Section 3: This is the side bar area, which contains the Data pane and the Analytics pane. The Data pane shows the details of the fields coming from the data, which are classified as either Dimensions or Measures. The Analytics pane, on the other hand, shows the various analyses, such as constant line, average line, median with quartiles, totals, trend line, forecast line, and clusters, that can be performed on the view that you create. To begin with, the Analytics pane is disabled or grayed out and will only start appearing when you create a view or visual. Section 4: This is the Dimensions and Measures section, which technically is part of the Data pane (and, if you are working with a version of Tableau later than 2020.1, it may not appear in the view). Dimensions are all the fields from the data that are categorical, descriptive, or qualitative in nature, such as Customer Name, Product Name, Order ID, and Region. These, when fetched in the view, will result in each data member of that field being displayed in the view. Measures, on the other hand, are fields from the data that are quantitative in nature and can be aggregated as either sum, average, minimum, maximum, standard deviation, variance, and so on. These, when fetched in the view, will result in aggregated values being displayed. Examples of Measures are fields such as Sales, Profit, and Quantity, which will be aggregated for the purpose of your analysis. Refer to the following screenshot for more clarity:

Figure 1.19: A screenshot showing the difference between Dimensions and Measures

Section 5: This is the Sheet tab. Here you get the option to create either a new worksheet, dashboard, or storyboard.Section 6: These are the various cards and shelves available for use in Tableau. Here you can see various shelves such as the Columns shelf, Rows shelf, Pages shelf, and Filters shelf, along with the Marks card, which contains shelves such as the Color shelf, Size shelf, Text shelf, Detail shelf, and the Tooltip shelf. These shelves are used to change the appearance and details of your view. Section 7: This is the View section. This is where you will create your visualizations. It can be referred to as the canvas for creating your views and visualizations.

Now that you are familiar with the workspace of Tableau, you can create your first visualization. To create your views or visualizations, you can either try the manual drag and drop approach or the automated approach of using the Show Me button. Let's explore both of these options.

You will begin with the manual drag and drop approach and then explore the automated approach using the Show Me button in the following exercise.

Exercise 1.02: Creating a Comparison Chart Using Manual Drag and Drop

The aim of this exercise is to create a chart to determine which ship mode is better in terms of Sales by Region using the manual drag and drop method. In this case, you will create one stacked bar chart using the Ship Mode, Region, and Sales fields from the Orders data from Sample - Superstore.xlsx and another by manually dragging the fields from the Data pane and dropping them into the necessary shelves.

Perform the following steps to complete this exercise:

Drag the Sales field from the Measures section in the Data pane and drop it onto the Columns shelf. This will create a horizontal bar.Drag the Region field from the Dimensions section from the Data pane and drop it onto the Rows shelf. This will create a horizontal bar chart with labels for regions and bars showing the sum of Sales.

Figure 1.20: A screenshot showing the stacked bar chart created using the manual drag and drop method

Finally, to include the ship mode, drag the Ship Mode field from the Dimensions section in the Data pane and drop it onto the Color shelf available under the Marks card. This will update your view to show a stacked bar chart with ship modes as colors, as in the following screenshot:

Figure 1.21: A screenshot showing the stacked bar chart created using the manual drag and drop method

In this exercise, you created a stacked bar chart to show which ship mode is better in terms of Sales across Regions using the manual drag and drop method. As you can see in the preceding screenshot, the Standard Class ship mode seems to be performing best by comparison to other modes.

In the following exercise, you will create another sales comparison chart—but this time with the Show Me button.

Exercise 1.03: Creating a Comparison Chart Using the Automated Show Me Button Method

The aim of this exercise is to create a chart to determine which Ship Mode is better in terms of Sales by Region using the automated method via the Show Me button. Just like the previous exercise, you will create one stacked bar chart using the Ship Mode, Region, and Sales field from the Orders data of Sample-Superstore.xlsx and another using the Show Me button. You will then compare the resulting charts to determine which mode helps generate the highest sales.

In a new worksheet, perform the following steps to complete the exercise:

Press and hold the CTRL key on your keyboard and select the Region and Ship Mode fields from the Dimensions section and the Sales field from the Measures pane.

Note

You will need to keep the CRTL key pressed while doing multiple selections. Furthermore, if you are on an Apple device, use the Command key instead. Refer to the following link to find the list of equivalent macOS commands and keyboard shortcuts for both Windows and macOS: https://help.tableau.com/current/pro/desktop/en-us/shortcut.htm.

Once you have selected the necessary fields, click on the Show Me button, which can be seen in the extreme top-right corner of your Tableau workbook. Refer to the following screenshot:

Figure 1.22: A screenshot showing the Show Me button

Once you have clicked on the Show Me button, you will see the list of visualizations that are possible with your current selection of fields, that is, two dimensions (Region and Ship Mode) and one measure (Sales). Further, you will also see that the horizontal bar chart is highlighted. The highlighted chart (this is highlighted by Tableau in version 2020.1 with an orangish-brown rectangular border in the following screenshot) is the result of the in-built recommendation engine that is based on the best practices of data visualization.

Figure 1.23: A screenshot showing the possible charts and the Show Me button

You now have two options: you can either go ahead with the chart recommended by Tableau, which will create a horizontal bar chart (which is not the aim here), or select some other chart that is available and enabled in the Show Me button (ideally a stacked bar chart like the one that you created in the previous exercise). So, select the chart right next to the recommended one (the one that is highlighted using a black dotted circular border in the preceding screenshot). This is the stacked bar chart option, which is exactly what you wanted.

However, when you go ahead with this option, you see two things that are different from the output that you created in the previous exercise. Firstly, it is a vertically stacked bar chart and not a horizontal one, and, secondly, you have Region in the Color shelf instead of Ship Mode. Refer to the following screenshot:

Figure 1.24: A screenshot showing the output of the stacked bar chart option from the Show Me button

Now, neither of these things are technically wrong, but they are not what you wanted in this case, and so you will need to change them.

Firstly, change the orientation of your stacked bar chart from vertical to horizontal by clicking on the swap button in the toolbar, as shown in the following screenshot:

Figure 1.25: A screenshot showing the Swap Rows and Columns button

Next, interchange/swap your Region and Ship Mode fields so that you have Ship Mode in the Color shelf instead of Region.

To do this, press CTRL and select Region from the Color shelf as well as Ship Mode from the Rows shelf. Make sure the pills for these selected fields are now darker in color as the dark color indicates that the selection of these fields is retained.

Now, click on the dropdown of either the Region field or the Ship Mode field and choose the Swap option, as shown in the following screenshot:

Figure 1.26: A screenshot showing the Swap option of the CTRL multiselect and drop-down method

This produces the following output:

Figure 1.27: A screenshot showing the stacked bar chart created using the Swap options

In this exercise, you created a stacked bar chart to show which Ship Mode is better in terms of Sales by Regions using the manual drag and drop method. As you can see in the preceding screenshot, the Standard Class ship mode seems to generate more sales compared to the other ship modes.

Data Visualization Using Tableau Desktop

In an earlier section, you familiarized yourself with the workspace of Tableau and learned how to create a visualization using the manual drag and drop method as well as the automated Show Me button. During the course of this book and across various chapters, you will get into more details of this workspace and learn about some more of the options available in the toolbar as well as the other shelves.

Now that you have some fundamental knowledge of how to create a visualization using the aforementioned methods, you will now explore some concepts of data visualization and how to use these in Tableau Desktop.

Ideally, when you present your analysis and insights, you want your end user to be able to quickly consume the information that you have presented and make better decisions more quickly. One way to achieve this objective is to present the information in the right format. Each chart, graph, or visualization has a specific purpose, and it is particularly important to choose the appropriate chart for answering a specific goal or a business question.

Now, to be able to choose the appropriate chart, you first need to look at the data and answer the question "What is it that you need to do with your data?".

To help you make your decision, consider the following:

Do you wish to compare values?Do you wish to look at the composition of your data?Do you wish to understand the distribution of your data?Do you wish to find and understand the relationships between the various variables of your dataset?

Once you have addressed these points and determined what you wish to do with your data, you will also need to decide on the following:

How many variables do you need to look at at any given point in time?Do you wish to trend the data?

With the help of this list, you will be able to figure out which chart is the most appropriate one to answer your business questions. To elaborate on this point, begin by first categorizing your charts into four sections—namely, charts that help you either compare, determine the composition, show the distribution of your data, or else the ones that help you find relationships in your data.

Comparison, composition, distribution, and relationships are often referred to as the four pillars of data visualization and are described in greater detail here:

Comparison: When analyzing your data, a common (if not the most common) use case would be to compare your data. Comparison is often done between two or more values. Some examples of comparison would be sales revenue in different regions, how the performance of a particular sales representative compared to their colleagues, the profitability of different products, and so on.

Typically, you will see comparison being done across categorical data, that is, data members of a dimension (for example, comparison across regions wherein Region is a dimension, and East, West, North, and South are the data members of that dimension), but it can also be done across quantitative data, that is, across measures (for example, sales versus profit or actual sales versus budget sales).

Another type of comparison that is very common is a comparison over a period of time (for example, evaluating your monthly sales performance or which months are better for your business and whether there are any seasonal trends that you need to look out for).

So, based on the preceding information, you will further break down comparison as comparison across dimensional items or categorical data (for example, region-wise sales), comparison over time, and comparison across measures or quantifiable data (for example, sales versus quota).

The following list outlines the typical charts that should be used for each type of comparison:

Comparison across dimensional items:

Bar chartPacked bubble chartWord cloud

Comparison over time:

Bar chartLine chart

Comparison across measures:

Bullet chartBar chartComposition: Another common use case when analyzing your data is to find out what ratio or proportion each data member contributes to the whole. So basically, out of the total value, what is the contribution of each data member? This is typically referred to as a part to whole composition and it helps us understand how each individual part makes up the whole of something. For example, out of the total sales, which category is contributing the most? Or what is the breakdown of your total sales by region? And so on.

Typically, you end up showing a static snapshot of the composition of your data (for example, your market share along with the market share of your competitors at a given point in time), or you may also want to trend this information over a period of time (for example, how is your and your competitor's market share changing over a period of time). Both these perspectives are important and can provide some very valuable insights regarding your performance.

So, based on this information, you will further break down composition as composition (snapshot/static) and composition over time.

The following list outlines the typical charts that should be used for each type of composition:

Composition (snapshot/static):

Pie chartStacked bar chartTreemap

Composition over time:

Stacked bar chartArea chartDistribution: Finding the distribution of your data is important when you want to find patterns, trends, clusters, and outliers or anomalies