Tableau is an amazing data visualization platform! With it, you will be able to achieve incredible data discovery, data analysis, and data storytelling. You will accomplish all of these tasks and goals visually. In fact, Tableau is unique among all other data visualization tools because it uses VizQL, a visual query language. This means you won't write a lot of tedious SQL or MDX or painstakingly work through wizards to select a chart type and then link components together with data.
Instead, you will be interacting with the data in a visual environment and Tableau will automatically translate your actions into the necessary queries behind the scenes. Much of your work will be drag and drop. Tableau empowers you to work with data rapidly and iteratively, switch visualization types on-the-fly, and ask new questions and gain new insight.
This chapter introduces the foundational principals of data visualization in Tableau. You will take on the role of an analyst for a coffee chain. We'll work through a series of examples that will introduce the basics of connecting to data, exploring and analyzing the data visually, and finally, putting it all together in a fully interactive dashboard. These concepts will be developed far more extensively in subsequent chapters. This chapter lays the foundation, including:
Connecting to data in Access
Creating bar charts
Creating line charts
Creating geographic visualizations
Using Show Me
Putting everything together in a dashboard
Tableau connects to data stored in a wide variety of files and databases. This includes flat files such as Excel and text files, relational databases such as SQL Server and Oracle, cloud-based data sources such as Google Analytics and Amazon Redshift, and OLAP data sources such as Microsoft SQL Server Analysis Services. With very few exceptions, the process of building visualizations and performing analysis will be the same no matter what data source you use. We'll cover the details of connecting to different data sources in later chapters.
For now, we will connect to an Access data source included in the resources supplied with this book. This chapter's workbook includes a connection to the data source, but we will walk through the steps of connecting using a new workbook first:
Open Tableau. The home screen should appear. If you are not on the home screen, then from the menu, navigate to Data | New Data Source.
Under Connect in the To a file section, click on Microsoft Access.
Click on Browse… and navigate to the
Learning Tableau\Data
directory and openCoffee Chain.mdb
.The database does not contain any security, so you do not need to adjust either the Database Password or Workgroup Security options. Click on OK to connect.
Tableau's data connection screen allows you to visually create connections to data sources. We'll look at the details of this screen in the next chapter. For now, drag the CoffeeChain Query table, located on the left-hand side under Table, into the center of the screen. This query contains all the fields we'll need in order to build our initial visualizations and the dashboard. The query functions look like a single table in the Tableau connection.
Once you have configured a data connection, you can create visualizations and dashboards by clicking on a tab at the bottom. Click on the Sheet 1 tab in the lower-left corner.
If the Show Me panel is displayed in the upper-right corner, collapse it by clicking at the top of the panel where the Show Me text appears.
You should now be in the main work area of Tableau, which looks like this:

Locate the numbered features of the main workspace. We'll refer to these features throughout the book, so familiarize yourself with the terminology:
1: The menu allows you to perform a wide variety of functions.
2: The toolbar makes common functions, such as undo, redo, save, connect to data, and so on, easily available.
3: The sidebar appears on the left-hand side and contains different features and controls based on your current task (for example, data visualization, applying analytics, formatting, or designing dashboards). The default sidebar in the main workspace consists of two tabs allowing you easy access to data and analytics. The Data window consists of data source connection(s), and the fields contained in the data sources are divided into Dimensions and Measures.
4: You can drag and drop data fields from the Data window onto various shelves, such as Pages, Filters, Columns, Rows, Color, Size, and Text.
5: The canvas (sometimes called the view or visualization) is where Tableau will draw visualizations based on where you drag and drop fields. You may also drag and drop fields directly onto the canvas.
6: The tabs give you easy access to the data connection screen and also to each sheet, dashboard, and story you create in the current workbook. At the bottom is a single tab named Sheet 1. As you build your workbook, you will most likely add new sheets (often also called views), which are individual visualizations. You may also add dashboards (these combine and relate multiple sheets and other components together on a single screen) and even stories (these combine multiple dashboards and views into a unified data story). A set of buttons next to the existing tabs allows the quick creation of new sheets, dashboards, or stories.
7: The status bar will give you information about the current view and includes some options on the right-hand side to navigate sheets in the workbook.
Having created your connection to the data, you are ready to begin to visualize and analyze the data. Over the course of the following examples, you'll take on the role of an analyst for the coffee chain. We'll build multiple visualizations that answer various questions and finally put everything together in an interactive dashboard. As we begin, let's consider a few of the foundational principles.
When you first connect to a data source such as the coffee chain data, Tableau will display the data connection and the fields in the Data window in the sidebar on the left-hand side. Fields can be dragged from the Data window onto various parts of the view on the right-hand side. Fields can be dropped onto the canvas area or onto various shelves, such as Rows, Columns, Color, or Size. The placement of the fields will result in different encodings of the data based on the type of field.
The fields from the data source are visible in the Data window and are divided into Measures and Dimensions. Understanding the difference between Measures and Dimensions is essential.
Note
Measures are values that are aggregated. That is, they can be summed, averaged, counted, or they can have a minimum or maximum.
Dimensions are values that determine the level of detail at which measures are aggregated. You can think of them as slicing the measures or creating groups into which the measures fit. The combination of dimensions used in the view defines the view's basic level of detail.
As an example, consider a view created using the Sales and Market fields from the coffee chain connection.

The Sales field is used as a measure in this view. Specifically, it is aggregated as an average. When you use a field as a measure in the view, the type aggregation (for example, SUM, MIN, and MAX) will be shown on the active field. Note in the preceding example that the active field on Rows clearly indicates the average aggregation of sales: AVG(Sales).
The Market field is a dimension with one of four values for each record of data: Central, East, South, or West. When the field is used as a dimension in the view, it slices the measure. So instead of an overall average, the view in the preceding example shows you the average sales for each market.
Note
Tableau makes it easy to recategorize fields and change default aggregations.
You can recategorize a field in the Data window as a dimension or measure by simply dragging the field from Measures to Dimensions or vice versa.
You can recategorize a field in the view as a dimension or measure by right-clicking on the field in the view and then selecting Dimensions or Measures.
You can change the default type of the aggregation of a measure by right-clicking on a Measures field in the Data window and navigating to Default Properties | Aggregation.
You can change the type of aggregation of a field in the view by right-clicking on the field in the view, selecting Measures, and then selecting the desired type of aggregation.
Another important distinction to make with fields is whether a field is being used as discrete or continuous. Tableau will give you a visual indication of the default for a field (the color of the icon in the Data window) and how it is being used in the view (the color of the active field on a shelf). Discrete fields are blue; continuous fields are green.
Whether a field is discrete or continuous, it determines how Tableau visualizes it based on where it is used in the view.
Note
Discrete (blue) fields have values that are shown as distinct and separate from each other. Discrete values can be reordered and still make sense.
When a discrete field is used on the Rows or Columns shelves, the field defines row or column headers.

When used for color, a discrete field defines a discrete color palette in which each color describes a distinct value of the field.

Continuous (green) fields have values that are shown as flowing from one field to another. Numeric and date fields are often used as continuous fields in the view. The values of these fields have an order that it would make no sense to change.
When used on Rows or Columns, a continuous field defines an axis.

When used for colors, a continuous field defines a gradient.

Most dimensions are discrete by default, and most measures are continuous by default. However, any numeric or date field, whether dimension or measure, can be used as a continuous field in the view. Any field, whether dimension or measure, can be used as a discrete field in the view.
Tip
To change the default of a field, right-click on the field in the Data window and select Convert to Discrete or Convert to Continuous.
To change how a field is used in the view, right-click on the field in the view and select Discrete or Continuous.
As you work through the examples in this chapter, pay attention to the fields you are using to create the visualizations, whether they are dimensions or measures, and whether they are discrete or continuous. Experiment with changing fields in the view from continuous to discrete and vice versa to gain an understanding of the difference in the visualization.