Home Data The Tableau Workshop

The Tableau Workshop

By Sumit Gupta , Sylvester Pinto , Shweta Sankhe-Savale and 2 more
books-svg-icon Book
Subscription FREE
eBook + Subscription $12.99
eBook $39.99
Print + eBook $48.99
READ FOR FREE Free Trial for 7 days. $12.99 p/m after trial. Cancel Anytime! BUY NOW BUY NOW BUY NOW
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
READ FOR FREE Free Trial for 7 days. $12.99 p/m after trial. Cancel Anytime! BUY NOW BUY NOW BUY NOW
Subscription FREE
eBook + Subscription $12.99
eBook $39.99
Print + eBook $48.99
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook + Subscription?
Download this book in EPUB and PDF formats
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with a Packt Subscription?
This book & 6500+ ebooks & video courses on 1000+ technologies
60+ curated reading lists for various learning paths
50+ new titles added every month on new and emerging tech
Early Access to eBooks as they are being written
Personalised content suggestions
Customised display settings for better reading experience
50+ new titles added every month on new and emerging tech
Playlists, Notes and Bookmarks to easily manage your learning
Mobile App with offline access
What do you get with eBook?
Download this book in EPUB and PDF formats
Access this title in our online reader
DRM FREE - Read whenever, wherever and however you want
Online reader with customised display settings for better reading experience
What do you get with video?
Download this video in MP4 format
Access this title in our online reader
DRM FREE - Watch whenever, wherever and however you want
Online reader with customised display settings for better learning experience
What do you get with Audiobook?
Download a zip folder consisting of audio files (in MP3 Format) along with supplementary PDF
  1. Free Chapter
    2. Data Preparation: Using Tableau Desktop
About this 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 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.
Publication date:
April 2022
Publisher
Packt
Pages
822
ISBN
9781800207653

 

2. Data Preparation: Using Tableau Desktop

Overview

In this chapter, you will learn to use various tools for data preparation in Tableau Desktop and join different data sources using various options. This will equip you with the knowledge required to perform data manipulation activities, data transformation, and data blending, and provide options to manage various data sources. By the end of this chapter, you will be able to extract and filter data and use aliases for the clean presentation of data.

 

Introduction

Often, the data sources required for Tableau visualizations are stored in separate tables or files. A very common example is that of an online order on an e-commerce website. The order information and the customer information are stored separately within the website database. However, when suggestions are provided based on previous purchases, the website might combine the information to show a unified view. This is a very simple example of a data join, which is one of the most common scenarios that can be fulfilled using data preparation techniques. In addition to data joining, there is often a need to perform data manipulation activities such as grouping and adding calculations on the data being used. In this chapter, you will learn about using all such techniques to pull the data into Tableau for effective analysis and visualization.

 

Connecting to a Data Source

For any visualization, you need to have an underlying data source that contains all the information you wish to show. This is the first step of any data visualization task.

The very first thing that you will see when you open Tableau Desktop is the Connect pane. Here, you can connect to a variety of data sources and perform various tasks related to data handling, which you will study in this chapter. The following figure shows the screen that comes up when you start Tableau Desktop:

Figure 2.1: Start screen on launching Tableau Desktop

Figure 2.1: Start screen on launching Tableau Desktop

Depending on the version, this screen might look slightly different, but it should remain this way for the most part: you can observe that you can connect to multiple file options such as Excel, text, and JSON files. You can also connect to server-based data sources such as MySQL and Oracle. Saved Data Sources provides sample data sources that are available with Tableau Desktop.

In the following exercise, you will connect to an Excel file named Sample - Superstore, which is available with Tableau Desktop. This file contains an Orders sheet, which consists of information for various orders, based on attributes such as order ID, order category, ship mode, and customer details. It also has a Returns sheet, which consists of orders that were returned. You will use all of this data to perform various operations throughout this chapter, and visualize the data in Tableau Desktop.

Exercise 2.01: Connecting to an Excel File

In this exercise, you will connect to your very first data source in Tableau, the Sample - Superstore Excel file. This file is automatically accessible to you if you have installed Tableau as mentioned in Chapter 1, Introduction to Tableau. It contains three sheets, comprising order-level information stored in the Orders sheet, customer information stored in the People sheet, and order returns stored in the Returns sheet, and can be quickly downloaded from the GitHub repository for this chapter at https://packt.link/14u86. Make sure to download this file on your system before proceeding with the exercise.

Perform the following steps to complete this exercise:

  1. Under the Connect pane, select the Microsoft Excel option.
Figure 2.2: Connecting to Microsoft Excel

Figure 2.2: Connecting to Microsoft Excel

  1. This will open up the file menu where you can select the Excel file from the file explorer. Navigate to the location where you have saved this file locally and then select to open the Sample-Superstore.xls file. You will see the following screen once the file is loaded:
 Figure 2.3: File import screen

Figure 2.3: File import screen

  1. Hover over the table to get the View data option (as highlighted in the following figure) and preview the data:
Figure 2.4: View data for the underlying sheet

Figure 2.4: View data for the underlying sheet

The following figure shows the data preview:

Figure 2.5: View Data window showing the data preview

Figure 2.5: View Data window showing the data preview

  1. Now, drag the Orders sheet onto the Drag sheets here area. This is also known as the canvas.
  2. The sheet should now have been imported into Tableau. Preview the data, as shown in the following figure:
Figure 2.6: Data preview of the imported sheet

Figure 2.6: Data preview of the imported sheet

You have thus connected and imported the data in Tableau.

  1. Hovering over Sheet 1, you can see the active Go to Worksheet option, which means that you can navigate to Sheet 1 and start creating visualizations.
Figure 2.7: Go to Worksheet popup

Figure 2.7: Go to Worksheet popup

Once the data is imported, you can start the visualization development by clicking on that option, as you will see later in the course.

In this exercise, you saw how you can connect to an Excel file. Tableau also allows you to connect to data that is stored on servers. In the next section, you will learn how this can be done.

Connecting to a Server Data Source

Here, you will be connecting with Microsoft SQL Server, available under the server-based data sources. Note that the concept of installing and maintaining server-based data sources is beyond the scope of this chapter. However, ideally, in a business project, data would mostly be stored on servers. For this reason, it is important to know how to connect to these data sources.

The following steps will help you connect to a server-based data source:

  1. Under the Connect pane, select the Microsoft SQL Server option, as can be seen in the following figure:
Figure 2.8: Server connection input screen

Figure 2.8: Server connection input screen

Here, you need to enter the information required, such as the server name and the authentication method. These details would be available from your database administrator.

  1. Click Sign In. You will get a similar preview screen as you saw in Figure 2.5. All the steps afterward are the same as you do for an Excel-based connection.

    Note

    One of the most commonly occurring issues here is that sometimes the drivers to connect to the data source are not installed. This can be easily resolved by downloading and installing the drivers from https://www.tableau.com/support/drivers.

In this section, you connected to a server-based data source. The next section covers the different kinds of joins in Tableau to combine the data from multiple data sources.

       
About the Authors
  • Sumit Gupta

    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.

    Browse publications by this author
  • Sylvester Pinto

    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.

    Browse publications by this author
  • Shweta Sankhe-Savale

    Shweta Sankhe-Savale is the Co-founder and Head of Client Engagements at Syvylyze Analytics (pronounced as "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 up numerous training as well as consulting assignments for customers across various sectors like BFSI, FMCG, Retail, E-commerce, Consulting & Professional Services, Manufacturing, Healthcare & Pharma, ITeS etc. She even had the privilege of working with some of the renowned Government and UN agencies as well. Combining her ability to breakdown complex concepts, with her expertise on Tableau's visual analytics platforms, Shweta has successfully trained over a 1300+ participants from 85+ companies.

    Browse publications by this author
  • JC Gillet

    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.

    Browse publications by this author
  • Kenneth Michael Cherven

    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.

    Browse publications by this author
The Tableau Workshop
Unlock this book and the full library FREE for 7 days
Start now