1
Taking Off with Tableau
Tableau is an amazing platform for seeing, understanding, and making key decisions based on your data! With it, you can carry out incredible data discovery, analysis, and storytelling. You'll accomplish these tasks and goals visually using an interface that is designed for the natural and seamless flow of thought and work.
You don't need to write complex scripts or queries to leverage the power of Tableau. Instead, you interact with your data in a visual environment where everything that you drag and drop is translated into the necessary queries for you and then displayed visually. In the latest versions of Tableau, you can even leverage AI to guide your analysis and automate some tasks. You'll be working in real time, so you will see results immediately, get answers as quickly as you can ask questions, and be able to iterate through potentially dozens of ways to visualize the data in order to find a key insight or tell a piece of the story.
This chapter introduces the foundational principles of Tableau. We'll walk through a series of examples that will introduce you to the basics of connecting to data, exploring and analyzing data visually, and finally, putting it all together in a fully interactive dashboard. These concepts will be developed far more extensively in subsequent chapters. However, don't skip this chapter, as it introduces key terminology and concepts, including the following:
- Connecting to data
- Foundations for building visualizations
- Visualizing data
- Using Show Me
- Putting everything together in a dashboard
Let's begin by looking at how you can connect Tableau to your data.
Connecting to data
Tableau connects to data stored in a wide variety of files, databases, and repositories. This includes flat files such as text files, Excel documents, and spatial files; databases such as SQL Server and Oracle; and cloud-based data sources such as Snowflake and Microsoft Azure. With very few exceptions, the process of analysis and creating visualizations will be the same, no matter what data source you use.
We'll examine data connections and related topics more extensively throughout the book. For example, we'll cover the following:
- Connecting to a wide variety of different types of data sources in Chapter 2, Connecting to Data and Tableau
- Using joins, blends, and object model connections in Chapter 13, Understanding the Tableau Data Model, Joins, and Blends
- Understanding the data structures that work well and how to deal with messy data in Chapter 14, Structuring Messy Data to Work Well in Tableau
- Leveraging the power and flexibility of Tableau Prep to cleanse and shape data for deeper analysis in Chapter 15, Taming Data with Tableau Prep
In this chapter, we'll connect to a text file derived from one of the sample datasets that ships with Tableau: Superstore.csv
. Superstore is a fictional retail chain that sells various products to customers across the United States and the file contains a record for every line item of every order with details on the customer, location, item, sales amount, and revenue.
Please use the supplied Superstore.csv
data file instead of the Tableau Superstore sample data, as there are differences that will change the results. Instructions for downloading all the samples can be found in the Preface.
The Chapter 1 workbooks, included with the code files bundle, already have connections to the file; however, for this example, we'll walk through the steps of creating a connection in a new workbook:
- Open Tableau. You should see the home screen with a list of connection options on the left and, if applicable, thumbnail previews of recently edited workbooks in the center, along with sample workbooks at the bottom.
- Under Connect and To a File, click on Text File.
- In the Open dialog box, navigate to the
\Learning Tableau\Chapter 01
directory and select the Superstore.csv
file.
You will now see the data connection screen, which allows you to visually create connections to data sources. We'll examine the features of this screen in detail in the Connecting to data section of Chapter 2, Connecting to Data and Tableau. For now, Tableau shows a list of fields and a preview of the file's data for the connection:
Figure 1.1: The data connection screen allows you to build a connection to your data
For this connection, no other configuration is required, so simply click on the Sheet 1 tab at the bottom of the Tableau window to start visualizing the data! You should now see the main work area within Tableau, which looks like this:
Figure 1.2: Elements of Tableau's primary interface, numbered, with descriptions to follow
We'll refer to the elements of the interface throughout the book using specific terminology, so take a moment to familiarize yourself with the terms used for the various components numbered in the preceding screenshot:
- The menu contains various menu items for performing a wide range of functions.
- The toolbar allows common functions such as undo, redo, save, add a data source, and so on.
- The Data pane is active when the Data tab is selected and lists all tables and fields of the selected data source. The Analytics pane is active when the Analytics tab is selected and gives options for supplementing visualizations with visual analytics.
- Various shelves, such as Pages, Columns, Rows, and Filters, serve as areas to drag and drop fields from the Data pane. The Marks card contains additional shelves, such as Color, Size, Text, Detail, and Tooltip. Tableau will visualize data based on the fields you drop onto the shelves.
Data fields in the Data pane are available to add to a view. Fields that have been dropped onto a shelf are called in the view or active fields because they play an active role in the way Tableau draws the visualization.
You may sometimes hear fields referred to as pills because of their appearance in the user interface.
- The canvas or view is where Tableau will draw the data visualization. In addition to dropping fields on shelves, you may also drop fields directly onto the view. A title is located at the top of the canvas. By default, the title displays the name of the sheet. It can be edited or hidden.
- Show Me is a feature that allows you to quickly iterate through various types of visualizations based on data fields of interest. We'll look at Show Me in the Using Show Me section.
- The tabs at the bottom of the window give you options for editing the data source, as well as navigating between and adding any number of sheets, dashboards, or stories. Often, any tab (whether it is a sheet, a dashboard, or a story) is referred to generically as a sheet or worksheet.
A Tableau workbook is a collection of data sources, sheets, dashboards, and stories. All of this is saved as a single Tableau workbook file (.twb
or .twbx
). A workbook is organized into a collection of tabs, which can be seen on the bottom toolbar in Tableau Desktop:
Figure 1.3: Tabs in a Tableau workbook
- A sheet is a single data visualization, such as a bar chart or a line graph. Since sheet is also a generic term for any tab, we'll often refer to a sheet as a view because it is a single view of the data.
- A dashboard is a presentation of any number of related views and other elements (such as text or images) arranged together as a cohesive whole to communicate a message to an audience. Dashboards are often designed to be interactive.
- A story is a collection of dashboards or single views that have been arranged to communicate a narrative from the data. Stories may also be interactive.
Along the bottom of the screen, you'll notice a few other items. As you work, a status bar at the bottom left will display important information and details about the view, selections, and the user. The controls on the bottom right allow you to navigate between sheets, dashboards, and stories, as well as viewing the tabs with Show Filmstrip or switching to a sheet sorter showing an interactive thumbnail of all sheets in the workbook.
Now that you have connected to the data in the text file, we'll explore some...