Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
The Tableau Workshop

You're reading from   The Tableau Workshop A practical guide to the art of data visualization with Tableau

Arrow left icon
Product type Paperback
Published in Apr 2022
Publisher Packt
ISBN-13 9781800207653
Length 822 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (5):
Arrow left icon
Shweta Savale Shweta Savale
Author Profile Icon Shweta Savale
Shweta Savale
Kenneth Michael Cherven Kenneth Michael Cherven
Author Profile Icon Kenneth Michael Cherven
Kenneth Michael Cherven
Sumit Gupta Sumit Gupta
Author Profile Icon Sumit Gupta
Sumit Gupta
Sylvester Pinto Sylvester Pinto
Author Profile Icon Sylvester Pinto
Sylvester Pinto
JC Gillet JC Gillet
Author Profile Icon JC Gillet
JC Gillet
+1 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface
1. Introduction: Visual Analytics with Tableau 2. Data Preparation: Using Tableau Desktop FREE CHAPTER 3. Data Preparation: Using Tableau Prep 4. Data Exploration: Comparison and Composition 5. Data Exploration: Distributions and Relationships 6. Data Exploration: Exploring Geographical Data 7. Data Analysis: Creating and Using Calculations 8. Data Analysis: Creating and Using Table Calculations 9. Data Analysis: Creating and Using Level of Details (LOD) Calculations 10. Dashboards and Storyboards 11. Tableau Interactivity: Part 1

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.

You have been reading a chapter from
The Tableau Workshop
Published in: Apr 2022
Publisher: Packt
ISBN-13: 9781800207653
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image