Tableau 10 Bootcamp

By Joshua N . Milligan , Donabel Santos
    Advance your knowledge in tech with a Packt subscription

  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
  1. Creating Your First Visualization and Dashboard

About this book

Tableau is a leading visual analytics software that can uncover insights for better and smarter decision-making. Tableau has an uncanny ability to beautify your data, compared to other BI tools, which makes it an ideal choice for performing fast and easy visual analysis.

A military camp style fast-paced learning book that builds your understanding of Tableau 10 in no time. This day based learning guide contains the best elements from two of our published books, Learning Tableau 10 - Second Edition and Tableau 10 Business Intelligence Cookbook, and delivers practical, learning modules in manageable chunks. Each chunk is delivered in a "day", and each "day" is a productive day. Each day builds your competency in Tableau. You will increase your competence in integrating analytics and forecasting to enhance data analysis during the course of this Bootcamp.

Each chapter presents core concepts and key takeaways about a topic in Tableau and provides a series of hands-on exercises. In addition to these exercises, at the end of the chapter, you will find self-check quizzes and extra drills to challenge you, to take what you learned to the next level. To summarize, this book will equip you with step-by-step instructions through rigorous tasks, practical callouts, and various real-world examples and assignments to reinforce your understanding of Tableau 10.

Publication date:
September 2017
Publisher
Packt
Pages
384
ISBN
9781787285132

 

Chapter 1. Creating Your First Visualization and Dashboard

Tableau is an amazing platform for achieving incredible data discovery, analysis, and storytelling. You can see, understand, and make decisions based on your data, using VizQL—a visual query language that is designed for a natural and seamless flow of thought and work. You do not need to learn VizQL; it's all done behind the scenes without forcing you to write tedious SQL scripts or MDX code, or painstakingly work through numerous wizards to select a chart type and then link everything to data.

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 and then displayed visually. You'll be working in real time, so you will see results immediately, get answers as fast as you can ask questions, and be able to iterate through dozens of ways to visualize the data to find a key insight or tell a piece of the story.

Tableau allows you to accomplish numerous tasks, including the following:

  • Data connection, integration,and preparation: Tableau allows you to connect to data from sources and, if necessary, create a structure that is ready to use. Most of the time, this is as easy as pointing Tableau to a database or opening a file, but Tableau gives you the tools to bring together even complex and messy data from multiple sources.
  • Data exploration: You can explore a dataset very easily using Tableau in order to understand what data you have visually.
  • Data visualization: This is the heart of Tableau. You can iterate through the countless ways of visualizing the data to ask and answer questions, raise new questions, and gain new insights.
  • Data analysis: Tableau has an ever growing set of analytical functions that allow you to dive deep into understanding complex relationships, patterns, and correlations in the data.
  • Data storytelling: Tableau allows you to build fully interactive dashboards and stories with your visualizations and insights so that you can share the data story with others.

We'll take a look at each of these tasks in the subsequent chapters. In this chapter, we will introduce the foundational principles of Tableau and focus on data visualization. We'll accomplish this 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 the subsequent chapters. However, don't skip this chapter as it introduces key terminologies and foundational concepts, including the following:

  • Connecting to data
  • Foundations for building visualization
  • Visualizing the data
  • Creating bar charts
  • Creating line charts
  • Creating geographic visualizations
  • Using Show Me
  • Bringing everything together in a dashboard
 

Connecting to data


Tableau connects to data stored in a wide variety of files and databases. These include 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 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.

For now, we'll connect to a text file, specifically, a Comma-separated Values file (.csv). The data itself is a variation of the sample data provided with Tableau for Superstore—a fictional retail chain that sells various products to customers across the United States. It's preferable to use the supplied data file instead of the Tableau sample data as the variations will lead to differences in visualizations.

chapter 01  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:

  1. Open Tableau to see the home screen with a list of connection options on the left-hand side, thumbnail previews of recently edited workbooks in the center, links to various resources on the right-hand side, and sample workbooks at the bottom.
  2. Under Connect and To a file, click on Text File.
  3. In the Open dialogue box, navigate to the \Learning Tableau\Chapter 01\ directory and select the Superstore.csv file.
  4. You will now see the data connection screen, which allows you to visually create connections to data sources. Notice that Tableau has already added and given a preview of the file for the connection:
  1. For this connection, no other configuration is required; so, to start visualizing the data, simply click on the Sheet 1 tab at the bottom! You should now see the main work area within Tableau, which looks similar to the following screenshot:

We'll refer to the elements of the interface throughout the book using specific terminology, so take a moment to get familiar with the terms used for the various components numbered in the preceding image:

  • The menu contains various menu items for performing a wide range of functions.
  • The toolbar allows for common functions, such as undo, redo, save, and add a data source.
  • The sidebar contains tabs for Data and Analytics. When the Data tab is active, we'll refer to the sidebar as the data pane. When the Analytics tab is active, we'll refer to the sidebar as the analytics pane. We'll go into details regarding this later in this chapter, but for now, note that the data pane shows the data source at the top, contains a list of fields from the data source and is divided into dimensions and measures.
  • Various shelves, such as Columns, Rows, Pages, 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 on the shelves.

Note

Data fields in the data pane are available to be added to the view. Fields that have been dropped on a shelf are called in the viewer active fields because they play an active role in the way Tableau draws the visualization.

  • The canvas or view is where Tableau draws data visualization. You may also drop fields directly onto the view. In Tableau 10, you'll observe the seamless title at the top of the canvas. By default, it will display the name of the sheet, but it can be either 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 toward the end of the chapter.
  • The tabs at the bottom of the window give you the option for editing the data source as well as navigating between and adding any number of sheets, dashboards, or stories—these are described as follows. Many times, generically, a tab (whether it is a sheet, dashboard, or story) is referred to as a sheet:
    • A sheet: A sheet is a single data visualization (such as a bar chart or 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: 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 interactive.
    • A story: A story is a collection of dashboards or single views arranged to communicate a narrative from the data. Stories can also be interactive.

Note

A Tableau workbook is the collection of data sources, sheets, dashboards, and stories. All of this is saved as a single Tableau workbook file (.twbor.twbx). We'll look at the differences in file types and explore details of what else is saved as a part of a workbook in later chapters.

  • As you work, the status bar will display important information and details about the view and selections.
  • Various controls allow you to navigate between sheets, dashboards, and stories as well as view the tabs as a filmstrip or switch to a Sheet Sorter showing an interactive thumbnail of all sheets in the workbook.

Now that you have worked through connecting to the data, 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, do the following:

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

Note

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.

With a connection to the data, you are now ready to visualize and analyze the data. As you start doing so, you will take on the role of an analyst at the retail chain. You'll ask questions to the data, build visualizations to answer those questions, and ultimately design a dashboard to share the results. Let's start by laying down some foundations to understand how Tableau visualizes data.

 

Foundations for building visualizations


When you first connect to a data source, such as the Superstore file, Tableau will display the data connection and the fields in the data pane on the left sidebar. Fields can be dragged from the data pane into 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.

Measures and dimensions

The fields from the data source are visible in the data pane and are divided into measures and dimensions. The difference between measures and dimensions is a fundamental concept to understand when using Tableau:

  • Measures: Measures are values that are aggregated. That is, they can be summed, averaged, counted, or have a minimum or maximum.
  • Dimensions: 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 a view's basic level of detail.

Let's consider a view (which you can view in the Chapter 01 Starter workbook on the Measures and Dimensions sheet) created using the Region and Sales fields from the Superstore connection, as follows:

The Sales field is used as a measure in this view. Specifically, it is being aggregated as a sum. When you use a field as a measure in the view, the type aggregation (example SUM, MIN, MAX, AVG) will be shown in the active field. In the preceding example, the active field on Rows clearly indicates the sum aggregation of Sales: SUM(Sales).

The Region field is a dimension with one of the 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 sum of sales, the preceding view shows the sum of sales for each region.

Discrete and continuous

Another important distinction to make with fields is whether a field is being used as discrete or continuous. Whether a field is discrete or continuous, determines how Tableau visualizes it based on where it is used in the view. Tableau will give you a visual indication of the default for a field (the color of the icon in the data pane) and how it is being used in the view (the color of the active field on a shelf). Discrete fields, such as Region in the previous example, are blue, and continuous fields, such as Sales, are green.

Discrete fields

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 headers. Here the discrete field Region defines the Columns headers:

Here, it defines the Row headers:

When used for color, a discrete field defines a discrete color palette in which each color aligns with a distinct value for the field:

Continuous fields

Continuous (green) fields have values which flow from first to last. Numeric and date fields are often used as continuous fields in the view. The values of these fields have an order changing which would make little sense.

When used on Rows or Columns, a continuous field defines an axis:

When used for color, a continuous field defines a gradient:

Noting that continuous and discrete are different concepts from measure and dimension is very important. While most dimensions are discrete by default and most measures are continuous by default, it is possible to use any measure as a discrete field and some dimensions as continuous fields.

Note

To change the defaults of a field, right-click on the field in the data pane 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 it to be either Discrete or Continuous.

In general, you can decide whether a field is continuous or discrete, using Tableau: how to display the data (header or axis, single colors or gradient) and measure or determine dimensions, using Tableau; and decide how to organize the data (aggregate it or slice/group it).

As you work through the examples in this chapter, pay attention to the fields you are using to create the visualizations, and check 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.

 

Visualizing data


A new connection to a data source is an invitation to explore. At times, you may come to the data with very well-defined questions and a strong sense of what you expect to find. At other times, you will come to the data with general questions and very little idea of what you will find. The data visualization capabilities of Tableau empower you to rapidly and iteratively explore the data, ask new questions, and make new discoveries.

The following visualization examples cover a few of the most foundational visualization types. Keep in mind that as you work through the examples, the goal is not simply to learn how to create a specific chart; rather, the examples are designed to help you think through the process of asking questions of the data and getting answers through iterations of visualization. Tableau is designed to make that process intuitive, rapid, and transparent. It is far more important to understand how and why to use Tableau to create a bar chart and then adjust your visualization to gain new insights as you ask new questions than memorizing steps to create a bar chart.

 

Creating bar charts


Bar charts visually represent data in a way that makes comparisons of a value across different categories easy. The length of the bar is the primary means by which you will visually understand the data. You may also incorporate color, size, stacking, and order to communicate additional attributes and values.

Creating bar charts in Tableau is very easy. Simply drag and drop the measure you want to see on either the Rows or Columns shelf and the dimension that defines the categories onto the opposing Rows or Columns shelf.

As an analyst for Superstore, you are ready to begin a discovery process focused on sales (especially the dollar value of sales). As you follow the examples, work your way through the sheets in the Chapter 01 Starter.twbx workbook. The Chapter 01 Complete.twbx workbook also contains the complete example so that you can compare your results at any time:

  1. Navigate to the Sales by Department sheet (view).
  2. Drag and drop the Sales field from Measures in the data pane to the Columns shelf. You now have a bar chart with a single bar representing the sum of sales for all the data in the data source.
  3. Drag and drop the Department field from Dimensions in the data pane to the Rows shelf. This slices the data to give you three bars, representing the sum of sales for each department:

You now have a horizontal bar chart which makes the comparison of sales between the departments easy. Notice how the mark type in the drop-down menu on the Marks card is set to Automatic, and it indicates that Tableau has determined that bars are the best visualization, given the fields you have placed in the view. As a discrete dimension, the Department field defines row headers for each department in the data. As a continuous measure, the Sales field defines an axis with the length of the bar extending from 0 to the value of the sum of sales for each department.

Note

Typically, Tableau draws a mark (bar, shape, circle, square, and so on) for every intersection of dimensional values in the view. In this simple case, Tableau is drawing a single bar mark for each dimensional value (Furniture, Office Supplies, and Technology) of the Department. The type of mark is indicated and can be changed in the drop-down menu on the Marks card. The number of marks drawn in the view can be observed on the lower-left status bar. Tableau draws different marks in different ways. For example, bars are drawn from 0 (or the end of the previous bar, if stacked) along the axis. Circles and other shapes are drawn at locations defined by the value(s) of the field defining the axis. Take a moment to experiment with selecting different mark types from the drop down on the Marks card. Having an understanding of how Tableau draws different mark types will help you master the tool.

Iterations of bar charts for deeper analysis

Using the preceding bar chart, you can easily see that the Technology department has more total sales than either Furniture or Office Supplies, and Office Supplies has lesser total sales compared to any other department. What if you want to further understand sales amounts for departments across various regions?

  1. Navigate to the Bar Chart (two levels) sheet, where you will find an initial view identical to the one you created previously.
  1. Drag the Region field from Dimensions in the data pane to the Rows shelf and drop it to the left of the Department field already in the view, as follows:

You still have a horizontal bar chart. But now, you've introduced Region as another dimension, which changes the level of detail in the view and further slices the aggregate of the sum of Sales. By placing Region before Department, you will be able to easily compare sales for each department within a given region.

Now you are starting to make some discoveries. For example, the Technology department has the most sales in every region, except in the East where Furniture had higher sales. Office Supplies never has the highest sales in any region.

Let's take a look at an alternative view, using the same fields arranged differently:

  1. Navigate to the Bar Chart (stacked) sheet, where you will find an initial view identical to the one you created previously.
  1. Drag the Region field from the Rows shelf and drop it on the Color shelf:

Instead of a side-by-side bar chart, you now have a stacked bar chart. Notice how each segment of the bar is color-coded according to the Region field. Additionally, a color legend has been added to the workspace. You haven't changed the level of detail in the view, so sales is still summed for every combination of region and department.

Note

The Level of Detail is a key concept when working with Tableau. In the most basic visualizations, the combination of values of all the dimensions in the view defines the lowest level of detail for that view. All measures will be aggregated or sliced by the lowest level of detail. In the case of the most basic views, the number of marks (indicated in the lower-left corner of the status bar) corresponds to the number of intersections of dimensional values. If Department is the only field used as a dimension, you will have a view at the department level of detail and all measures in the view will be aggregated as per the department. If Region is the only field used as a dimension, you will have a view at the region level of detail and all measures in the view will be aggregated as per the region. If you use both Department and Region as dimensions in the view, you will have a view at the level of department and region. All measures will be aggregated as per the unique combination of department and region.

Stacked bars are useful when you want to understand part-to-whole relationships. It is now fairly easy to see what portion of the total sales of each department is made in each region. However, it is very difficult to compare sales for most of the regions across departments. For example, can you easily tell which department had the highest sales in the East region? It is difficult because, with the exception of West, every segment of the bar has a different starting place.

Now, let's take some time to experiment with the bar chart to see what variations you can create:

  1. Navigate to the Bar Chart (experimentation) sheet.
  2. Try dragging the Region field from Color to the other shelves on the Marks card, such as Size, Label, and Detail. Observe that in each case, the bars remain stacked but are redrawn based on the visual encoding defined by the Region field.
  3. Use the Swap button on the toolbar to swap fields on Rows and Columns. This allows you to very easily change from a horizontal bar chart to a vertical bar chart (and vice versa).
  1. Drag and drop Sales from the Measures section of the data pane on top of the Region field on the Marks card to replace it. Drag the Sales field to Color if necessary and notice how the color legend is a gradient for the continuous field.
  2. Further, experiment by dragging and dropping other fields on to various shelves. Note the behavior of Tableau for each action you take.
  3. From the File menu, select Save.

Note

At the time of writing this book, Tableau does not have an auto-save feature. You will want to get in the habit of saving the workbook early and then pressing Ctrl S or selecting Save from the File menu often to avoid losing your work.

 

Line charts


Line charts connect the related marks in a visualization to show movement or relationship between connected marks. The position of the marks and the lines that connect them are the primary means of communicating the data. Additionally, you can use size and color to visually communicate additional information.

The most common kind of line chart is a time series chart. Time series charts show the movement of values over time. They are very easy to create in Tableau and require only a date and a measure.

Now, continue your analysis of Superstore sales using the Chapter 01 Starter workbook that you saved earlier. The following are the steps to get the output of the Sales over Time graph:

  1. Navigate to the Sales over time sheet.
  2. Drag the Sales field from Measures to Rows to give you a single, vertical bar representing the sum of all the sales in the data source.
  3. To turn this into a time series, you must introduce a date. Drag the Order Date field from Dimensions in the data pane on the left and drop it on Columns. Tableau has a built-in date hierarchy and the default level of year has given you a line chart connecting four years. Notice that you can clearly see an increase in sales year after year:
  4. Use the drop-down menu of the YEAR(Order Date) field on Columns (or right-click on the field) and switch the date field to Quarter. You may observe that Quarter is listed twice in the drop-down menu. We'll explore the various options for date parts, values, and hierarchies in the Visualizing dates and times section of Chapter 3,Moving from Foundational to More Advanced Visualizations. For now, select the second option:

Notice the cyclic pattern that is quite evident when looking at the sales by quarter:

Iterations offline charts for deeper analysis

Right now, you are looking at the overall sales over time. Let's do some analysis at a slightly deeper level:

  1. Navigate to the Sales over time (overlapping lines) sheet, where you will find a view identical to the one you just created.
  2. Drag the Region field from Dimensions to Color. Now, you have a line per region with each line being a different color and a legend indicating which color is used for which region. As with the bars, adding a dimension to color splits the marks. However, unlike the bars where the segments were stacked, the lines are not stacked. Instead, the lines are drawn at the exact value for the sum of sales for each region and quarter. This allows for easy and accurate comparison. It is interesting to note that the cyclic pattern can be observed for each region, as shown:

With only four regions, it's fairly easy to keep the lines separate. What about dimensions that have more than four or five distinct values? For this, perform the following:

  1. Navigate to the Sales over time (multiple rows) sheet, where you will find a view identical to the one you just created.
  2. Drag the Category field from Dimensions and drop it directly on top of the Region field currently on the Marks card. This replaces the Region field with Category. You now have 17 overlapping lines. Often you'll want to avoid more than 2 to 4 overlapping lines. However, clicking on an item in the color legend will highlight the associated line in the view. Highlighting can be a good way to pick out a single item and compare it with all others.
  3. Drag the Category field from Color on the Marks card and drop it on Rows. You now have a line chart for each category. Now, you have a way to compare each product over time without overwhelming the overlap function. You can still compare trends and patterns over time. This is the start of a spark-lines visualization.
 

Creating geographic visualizations


Tableau makes creating geographic visualizations very easy. The built-in geographic database recognizes geographic roles for fields, such as country, state, city, or zip code. Even if your data does not contain latitude and longitude values, you can simply use geographic fields to plot locations on a map. If your data contains latitude and longitude fields, you may use those instead of the generated values.

Note

Although most databases do not strictly define geographic roles for fields, Tableau will automatically assign geographic roles to the fields based on the field name and a sampling of values in the data. You can assign or re-assign geographic roles to any field by right-clicking on the field in the data pane and using the geographic role option. This is also a good way of seeing what built-in geographic roles are available.

In the following examples, we'll consider some of the foundational concepts of geographic visualizing.

Geographic visualization is incredibly valuable when you need to understand where things happen and if there are any spatial relationships within the data. Tableau offers two basic forms of geographic visualization:

  • Filled maps
  • Symbol maps

Filled maps

Filled maps, as the name implies, makes use of filled areas, such as country, state, county, or zip code, to show the location. The color which fills the area can be used to encode values of measures or dimensions.

What if you want to understand sales for Superstore and see if there are any patterns geographically? Let's take a look at how you can do this:

  1. Navigate to the Sales by State sheet.
  2. Double-click on the State field in the data pane. Tableau automatically creates a geographic visualization using the Latitude (generated), Longitude (generated), and State fields.
  1. Drag the Sales field from the data pane and drop it on the Color shelf on the Marks card. Based on the fields and shelves you've used, Tableau has switched the automatic mark type to filled maps:

The filled map fills each state with a single color to indicate the relative sum of sales for each state. The color legend, now visible in the view, gives the range of values and indicates that the state with the least sales had a total of $3,543 and the state with the most sales had a total of $1,090,616.

When you look at the number of marks displayed on the status bar on the lower-left side, you'll see that it is 49. Careful examination reveals that the marks consist of the lower 48 states, and Washington DC, Hawaii, and Alaska are not shown. Tableau will only draw a geographic mark, such as a filled state, if it exists in the data and is not excluded by a filter.

Note

Note that the map does display Canada, Mexico, and other locations not included in the data. These are part of a background image retrieved from an online map service. The state marks are then drawn on top of the background image.

Filled maps can work well in interactive dashboards and have quite a bit of aesthetic value. However, certain kinds of analyses are very difficult with filled maps. Unlike other visualization types where size can be used to communicate facets of data, the size of a filled geographic region only relates to the geographic size and can make comparisons difficult. For example, which state has the highest sales? You might be tempted to say Texas or California because they appear larger, but would you have guessed Massachusetts? Some locations may be small enough that they won't even show up compared with larger areas. Use filled maps with caution and consider pairing them with other visualizations on dashboards for clear communication.

Symbol maps

Another standard type of geographic visualization available in Tableau is a symbol map. Marks on this map are shapes or symbols placed at specific geographic locations. Size, color, and shape may also be used to encode additional dimensions and measures.

Let's continue with our analysis of Superstore sales following these steps:

  1. Navigate to the Sales by Postal Code sheet.
  2. Double-click on Postal Code under Dimensions. Tableau automatically adds Postal Code to the Detail of the Marks card and Longitude (generated) and Latitude (generated) to Columns and Rows. The Mark type is set to a circle by default and a single circle is drawn for each postal code at the correct latitude and longitude. You may also notice an indicator for the 1 unknown postal code.
  3. Drag Sales from Measures to the Size shelf on the Marks card. This causes each circle to be sized according to the sum of sales for that postal code.
  4. Drag Profit from Measures to the Color shelf on the Marks card. This encodes the mark color to correspond to the sum of profit. You can now see the geographic location of profit and sales at the same time. This is useful because you will see some locations with high sales and low profit that may require some action.

The final view should look like this after making some fine tuned adjustments to size and color detailed:

Sometimes, you'll want to adjust the marks on symbol map to make them more visible. Some of the options are as follows:

  • If marks are overlapping, click on the Color shelf and set transparency to somewhere between 50% and 75%. Additionally, add a dark border. This makes the marks stand out and you can often discern any overlapping marks much better.
  • If marks are too small, click on the Size shelf and adjust the slider. You can also double-click on the Size value legend and edit the details of how Tableau assigns size.
  • If marks are too faint, double-click on the Color legend and edit the details of how Tableau assigns color. This is especially useful when you are using a continuous field that defines a color gradient.

A combination of tweaking the size and using Stepped Color and Use Full Color Range, as shown here, produced the final result for this example:

Unlike filled maps, symbol maps allow you to use size to visually encode aspects of the data. Symbol maps also allow for greater precision. In fact, if you have latitude and longitude in your data, you can very precisely plot marks at a street address level of detail. This type of visualization allows you to map locations that do not have clearly defined boundaries. Notice that if you were to change the mark type from Automatic to Filled Map in the preceding view, you would get an error message indicating that filled maps are not supported at the level of detail in the view.

 

Using Show Me


Show Me is a powerful component of Tableau, which is used to arrange selected and active fields into the arrangement required for the selected visualization type. The Show Me toolbar displays small thumbnail images of different types of visualizations, thus allowing you to create visualizations with a single click. Based on the fields you select in the data pane and the fields which are already in the view, Show Me will enable possible visualizations and highlight a recommended visualization. Let's explore the features of Show Me using these steps:

  1. Navigate to the Show Me sheet.
  2. If the ShowMe pane is not expanded, click on the Show Me button in the upper-right corner of the toolbar to expand the pane.
  1. Press and hold the Ctrl key while clicking on the Postal Code, State, and Profit fields in the data pane to select each of those fields. With those fields highlighted, Show Me should look similar to this screenshot:

Notice that the Show Me window has enabled certain visualization types such as text tables, heat maps, symbol maps, filled maps, and bar charts. These are the visualizations that are possible, given the fields are already in the view in addition to any selected in the data pane. Show Me highlights the recommended visualization for the selected fields and also gives a description of what fields are required as you hover over each visualization type. Symbol maps, for example, require one geographic dimension and up to two measures.

Other visualizations are grayed out, such as line charts and histograms. Show Me will not create these visualization types with the fields that are currently in the view and selected in the data pane. Hover over the grayed out line charts in Show Me. Show Me indicates that line charts require one or more measures, which you have selected, but also require a date field, which you have not selected.

Note

Tableau will actually draw line charts with fields other than dates. Show Me gives you options for what is typically considered a good practice for visualizations. However, there may be times when you know a line chart would accurately show your data. Understanding how Tableau renders visualizations based on fields and shelves instead of always relying on Show Me will give you a much greater flexibility in your visualizations and will allow you to rearrange things when Show Me doesn't give the exact results you want. At the same time, you will need to cultivate an awareness of good visualization practices.

Show Me can be a powerful way to quickly iterate through different visualization types as you search for insights into the data. But as a data explorer, analyst, and storyteller, you should consider Show Me as a helpful guide giving suggestions. You may know that a certain visualization type will answer your questions more effectively than the suggestions of Show Me. You may also have a plan for a visualization type that will work well as part of a dashboard, but isn't even included in Show Me.

Note

You will be well on your way to learning and mastering Tableau when you can use Show Me effectively, but feel just as comfortable building visualizations without it. Show Me is powerful for quickly iterating through visualizations as you look for insights and raise new questions. It is a wonderful teaching and learning tool useful for starting with a standard visualization that you can further customize. Be careful not to use it as a crutch without understanding how visualizations are actually built from the data. Take time to evaluate why certain visualizations are or are not possible. Pause to see what fields and shelves were used when you selected a certain visualization type.

Conclude the Show Me example by experimenting with ShowMe by clicking on various visualization types, looking for insights into the data that may be more or less obvious based on the visualization type. Circle views and box and whisker plots show the distribution of postal codes for each state. Bar charts easily expose several postal codes with negative profit.

 

Bringing everything together in a dashboard


Dashboards are often interactive and allow end users to explore different facets of the data. Tableau makes it very easy to use multiple visualizations together on a dashboard. In Tableau, a dashboard is a collection of views, filters, parameters, images, and other objects that work together to communicate a data story.

Dashboards serve as a wide variety of purposes and can be tailored for a wide variety of audiences. Consider the following possible dashboards:

  • A summary level view of profit and sales to allow executives to have a quick glimpse into the current status of the company
  • An interactive dashboard allowing sales managers to drill into sales territories to identify threats or opportunities
  • A dashboard allowing doctors to track patient re-admissions, diagnosis, and procedures in order to make better decisions about patient care
  • A dashboard allowing executives of a real-estate company to identify trends and make decisions for various apartment complexes
  • An interactive dashboard for loan officers to make lending decisions based on portfolios broken down by credit ratings and geographic location

Let's take a look at an example that introduces the foundational concepts:

  1. Navigate to the Superstore Sales sheet, which is a blank dashboard. The sidebar on the left now shows options for building a dashboard instead of the data pane that was visible in the worksheet:

The dashboard window consists of several key components. The left sidebar contains two tabs:

  • A Dashboard tab for sizing options, and adding sheets and objects to the dashboard
  • A Layout tab for adjusting the layout of various objects on the dashboard

The Dashboard pane contains options for previewing based on target device, sizing options, and a list of all visible sheets (views) in the dashboard. You can add these sheets to a dashboard by dragging and dropping. As you drag the view, a light gray shading will indicate the location of the sheet in the dashboard once it is dropped. You can also double-click on any sheet and it will be added automatically.

The next section lists multiple additional objects that can be added to the dashboard. Horizontal and Vertical layout containers will give you finer control over the layout, and text allows you to add text labels and titles. Images and even embedded web content can be added. Finally, a Blank object allows you to preserve blank space in a dashboard or can serve as a place holder.

You can toggle to select whether new objects will be added as Tiled or Floating. Tiled objects will snap into a tiled layout next to other tiled objects or within layout containers. Floating objects will float on top of the dashboard in successive layers.

Building your dashboard

Now, let's build a dashboard:

  1. Successively, double-click on each sheet listed in the Dashboard section on the left: Sales by Department, Sales over time, and Sales by Postal Code. Notice that double-clicking on the object adds it to the layout of the dashboard.

Note

When a worksheet is first added to a dashboard, any legends, filters, or parameters that were visible in the worksheet view will be added to the dashboard. If you wish to add them in at a later point, select the sheet in the dashboard and click on the little drop-down caret in the upper-right corner. Nearly every object has a drop-down caret providing many options for fine tuning the appearance and controlling the behavior. Take note of the various UI elements that become visible for selected objects on the dashboard, as shown here:

 

  1. Add a title to the dashboard by checking Show Title in the lower-left corner of the sidebar. Make sure that nothing is selected in the dashboard (such as a view or legend), otherwise the Show Title checkbox will likely apply to the selection. If necessary, click in a gray area off the dashboard or a blank area in the left sidebar to clear any objects selections. You may edit the title by double-clicking on it.
  2. Select the Sales by Department sheet in the dashboard and click on the drop-down caret in the upper-right corner. Go to Fit | Entire View. The fit options describe how the visualization should fill any available space.

Note

Be careful when using various fit options. If you are using a dashboard with a size that has not been fixed or if your view dynamically changes the number of items displayed based on interactivity, then what might have once looked good might not fit the view nearly as well.

  1. Select the Sales size legend by clicking on it. Use the remove UI element to remove the legend from the dashboard.
  2. Select the Profit color legend by clicking on it. Use the grip to drag the legend and place it under the map.
  3. For each view, Sales by Department, Sales by Postal Code, and Sales over time, select the view by clicking in an empty area in the view. Then click on the Use as Filter UI element to make that view an interactive filter for the dashboard. Your dashboard should look similar to this:
  1. Take a moment to interact with your dashboard. Click on the various marks, such as the bars, states, and points of the line. Notice that each selection filters the rest of the dashboard. Clicking on a selected mark will deselect it and clear the filter. Notice that selecting marks in multiple views cause filters to work together. For example, selecting the bar for Furniture in Sales by Department and 2016 Q4 in Sales over time, allows you to see all the postal codes that had furniture sales in the first quarter of 2016:

You have now created a dashboard that allows for interactive analysis. As an analyst for the Superstore chain, your visualizations allowed you to explore and analyze the data. The dashboard you created can be shared with the management as a tool to help them see and understand the data in order to make better decisions. When a manager selects the Furniture department, it immediately becomes obvious that there are locations where sales are quite high, but profit is actually a loss. This may lead to decisions such as a change in marketing or a new sales focus for that location. Most likely it will require additional analyses to determine the best course of action. In that case, Tableau will empower you to continue the cycle of discovery, analysis, and storytelling.

 

Summary


Tableau's visual environment allows for a rapid and iterative process of exploring and analyzing data visually. You've taken your first steps in understanding how to use the platform. You connected to data and then, explored and analyzed it using some foundational visualization types such as bar charts, line charts, and geographic visualizations. Along the way, you focused on learning the techniques and understanding key concepts such as the difference between measures and dimensions, and discrete and continuous fields. Finally, you put all the pieces together to create a fully functional dashboard that allows an end user to understand your analysis and make discoveries of their own.

In the next chapter, we will add a few more interactive components to our views. Interactivity in Tableau can be achieved in many different ways using filters, parameters, and calculated fields to give the users of our dashboards more control over what is being shown in the charts.

About the Authors

  • Joshua N . Milligan

    Joshua N. Milligan has been with Teknion Data Solutions since 2004 and currently serves as a principal consultant. With a strong background in software development and custom .NET solutions, he brings a blend of analytical and creative thinking to BI solutions, data visualization, and data storytelling. His years of consulting have given him hands on experience in all aspects of the BI development cycle from data modeling, ETL, enterprise deployment, data visualization, and dashboard design. He has worked with clients in numerous industries including financial, energy, healthcare, marketing, government, and services. Joshua has been named by Tableau as a Tableau Zen Master every year since 2014. This places Joshua in a group of individuals recognized by Tableau as not only masters of the tool but also who have a deep desire to teach and help others. As a Tableau Ambassador, trainer, mentor, and leader in the online Tableau community, Joshua is passionate about helping others gain insights from their data. He frequently broadcasts webinars to educate and inform the Tableau community and the world at large about the wonders of Tableau and is a much sought after featured speaker at Tableau conferences, user groups and various technology and industry functions. He thrives on helping others. Joshua is the author of the first edition of Learning Tableau, which quickly became one of the highest acclaimed Tableau books for users at all levels. He was a technical reviewer of the Tableau Data Visualization Cookbook, Creating Data Stories with Tableau Public, and his work has been featured multiple times on Tableau Public’s Viz of the Day and Tableau’s website. He also shares frequent Tableau tips, tricks, and advice along with a variety of dashboards on his fun and creative blog site, VizPainter. You can follow Joshua on Twitter at @VizPainter.

    Browse publications by this author
  • Donabel Santos

    Donabel Santos is a self-confessed data geek. She loves working with data, writing queries, and developing reports on her SQL Server databases, and exploring and visualizing data with Tableau.

    She is the principal and senior business intelligence architect at QueryWorks Solutions, a Tableau Learning and Alliance partner in Vancouver, BC, Canada, providing consulting and training services. She has spent years in consulting and has developed a variety of solutions for clients in different verticals—finance, manufacturing, healthcare, legal, higher education, and local government.

    Donabel is a multi-year Microsoft Data Platform MVP (previously known as SQL Server MVP) and has extensive experience in the SQL server in different areas, such as development, administration, data warehouse, reporting (SSRS), tuning, troubleshooting, XML, CLR, and integration with ERPs and CRMs using PowerShell, C#, SSIS, and Power BI.

    One of Donabel's passions is teaching and sharing her love for data. She is a Tableau Certified Professional and a Tableau accredited trainer, delivering Tableau public and on-site client training. She is also the lead instructor for a number of courses at British Columbia Institute of Technology (BCIT), including Applied Database Administration and Design (ADAD) and Applied Data Analytics (ADA) programs. She teaches SQL server administration, development, integration (SSIS), data warehouse foundations, and visual analytics with Tableau.

    Donabel has also authored three other books with Packt Publishing: SQL Server 2012 with PowerShell V3 Cookbook, PowerShell for SQL Server Essentials, and SQL Server 2014 with PowerShell V5 Cookbook. She also contributed a chapter to Manning Publications' PowerShell Deep Dives.

    Browse publications by this author
Tableau 10 Bootcamp
Unlock this book and the full library for FREE
Start free trial