Book Image

Learning Tableau 2022 - Fifth Edition

By : Joshua N. Milligan
Book Image

Learning Tableau 2022 - Fifth Edition

By: Joshua N. Milligan

Overview of this book

Learning Tableau 2022 helps you get started with Tableau and data visualization, but it does more than just cover the basic principles. It helps you understand how to analyze and communicate data visually, and articulate data stories using advanced features. This new edition is updated with Tableau’s latest features, such as dashboard extensions, Explain Data, and integration with CRM Analytics (Einstein Analytics), which will help you harness the full potential of artificial intelligence (AI) and predictive modeling in Tableau. After an exploration of the core principles, this book will teach you how to use table and level of detail calculations to extend and alter default visualizations, build interactive dashboards, and master the art of telling stories with data. You’ll learn about visual statistical analytics and create different types of static and animated visualizations and dashboards for rich user experiences. We then move on to interlinking different data sources with Tableau’s Data Model capabilities, along with maps and geospatial visualization. You will further use Tableau Prep Builder’s ability to efficiently clean and structure data. By the end of this book, you will be proficient in implementing the powerful features of Tableau 2022 to improve the business intelligence insights you can extract from your data.
Table of Contents (20 chapters)
18
Other Books You May Enjoy
19
Index

Taking Off with Tableau

Tableau is an amazing platform for seeing, understanding, and making key decisions based on your data! With it, you will be able to carry out incredible data discovery, analysis, and storytelling. You’ll accomplish these tasks and goals visually using an interface that is designed for a 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 will be interacting with your data in a visual environment where everything that you drag and drop will be translated into the necessary queries for you and then displayed visually. 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 go 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
  • Creating bar charts
  • Creating line charts
  • Creating geographic visualizations
  • Using Show Me
  • Bringing 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 and databases. This includes flat files, such as Excel documents, spatial files, and text files; relational databases, such as SQL Server and Oracle; cloud-based data sources, such as Snowflake and Amazon Redshift; and Online Analytical Processing (OLAP) data sources, such as Microsoft SQL Server Analysis Services. With very few exceptions, the process of analysis and creating visualizations will be the same, no matter what data source you use.

We’ll cover 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 in Tableau
  • Using joins, blends, and object model connections in Chapter 14, Understanding the Tableau Data Model, Joins, and Blends
  • Understanding the data structures that work well and how to deal with messy data in Chapter 15, 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 16, 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 sample data, as there are differences that will change the results. Instructions for downloading all the samples are 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 in Tableau. For now, Tableau has already added a preview of the file 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 below

We’ll refer to elements of the interface throughout the book using specific terminology, so take a moment to familiarize yourself with the terms used for various components numbered in the preceding screenshot:

  1. The menu contains various menu items for performing a wide range of functions.
  2. The toolbar allows common functions such as undo, redo, save, add a data source, and so on.
  3. 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.
  4. 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.

  1. 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, but it can be edited or hidden.
  2. 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.
  3. 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.

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 of various types:

  • 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. Although obscured by the Show Me window in Figure 1.1, you’ll find other controls at the bottom right that 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 examples that lay the foundation for data visualization and then move on to building some foundational visualization types. To prepare for this, please do the following:

  1. From the menu, select File | Exit.
  2. When prompted to save changes, select No.
  3. From the \learning Tableau\Chapter 01 directory, open the file Chapter 01 Starter.twbx. This file contains a connection to the Superstore data file and is designed to help you walk through the examples in this chapter.

The files for each chapter include a Starter workbook that allows you to work through the examples given in this book. If, at any time, you’d like to see the completed examples, open the Complete workbook for the chapter.

Having made a connection to the data, you are ready to start visualizing and analyzing it. As you begin to do so, you will take on the role of an analyst at the retail chain. You’ll ask questions of the data, build visualizations to answer those questions, and ultimately design a dashboard to share the results. Let’s start by laying some foundations for understanding how Tableau visualizes data.