Learning Tableau 2025 - Joshua N. Milligan - E-Book

Learning Tableau 2025 E-Book

Joshua N. Milligan

0,0
29,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Tableau 2025 marks a new era in data visualization and analysis, bringing together advanced AI integrations and dynamic user experiences. This sixth edition, written by Tableau Visionary and Zen Master Joshua Miligan, is an end-to-end guide to mastering the latest innovations in Tableau that transform raw data into actionable insights.
This edition introduces groundbreaking features like Tableau AI (including Tableau Pulse and Tableau Agent), enhancing your analytical capabilities with AI-driven data exploration and automated insights. With detailed walkthroughs, you’ll learn to build dynamic dashboards that respond to your data in real time and work with sophisticated AI functionalities that predict trends and model scenarios.
Whether you're a seasoned data professional or new to Tableau, this book provides the tools you need to leverage Tableau’s full potential. From integrating diverse data sources using the enhanced data model to employing advanced geospatial functions for detailed mapping, every chapter is packed with expert knowledge and practical applications designed to put powerful analytics at your fingertips.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 651

Veröffentlichungsjahr: 2025

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Learning Tableau 2025

Sixth Edition

Leverage Tableau’s newest features to revolutionize your data storytelling with AI-enhanced insights 

Joshua N. Milligan

Learning Tableau 2025

Sixth Edition

Copyright © 2025 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing and its dealers and distributors will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Portfolio Director: Sunith Shetty

Relationship Lead: Apeksha Shetty

Project Manager: Shashank Desai

Content Engineers: Shrishti Pandey, Ayushi Bulani, David Sugarman

Technical Editor: Gaurav Gavas

Copy Editor: Safis Editing

Indexer: Tejal Soni

Proofreaders: Shrishti Pandey, Ayushi Bulani, David Sugarman

Production Designer: Aparna Bhagat

Growth Lead: Bhavesh Amin

First published: April 2015

Second edition: September 2016

Third edition: March 2019

Fourth edition: August 2020

Fifth edition: August 2022

Sixth edition: July 2025

Production reference: 1180725

Published by Packt Publishing Ltd.

Grosvenor House

11 St Paul’s Square

Birmingham

B3 1RB, UK.

ISBN 978-1-83588-678-6

www.packtpub.com

To my dad and mom, Stuart and LaNita, who encouraged me to pursue my interests and allowed me to spend hours on the family computer. To my children, Caleb, Rachel, Daniel, and Grace, who are currently pursuing their varied interests and keeping me on my toes. To my wife, Kara, who is my best friend and partner in life, as she continues to love and support me in everything.

– Joshua Milligan

Contributors

About the author

Joshua N. Milligan is a Tableau Hall of Fame Visionary (formerly known as Zen Master). He is an Iron Viz finalist and author of every edition of Learning Tableau. Bringing a creative approach, he loves to share in-depth knowledge with the Tableau Community. His passion is training, mentoring, and helping people gain insights and make decisions through visual analytics using Tableau. He is a principal consultant at Resultant, where he has served clients in numerous industries since 2004.

I want to thank my colleagues at Resultant, the Tableau Community and DataFam, all the staff at Packt, along with the reviewers. I especially want to thank my wife, who has lovingly supported me in everything.

About the reviewers

Nick Katko is a seasoned data and analytics professional with over 18 years of experience in architecting, developing, and delivering actionable insights through visually compelling dashboards. After discovering the original Polaris paper (the Stanford technical report that became Tableau’s foundation) in 2007, he hitched himself to the Tableau rocket ship and has been on a wild ride ever since. Earning multiple Tableau and business systems certifications throughout his career, Nick has partnered with various consultancies and many Fortune 500 organizations to modernize analytics platforms, lead enablement initiatives, and solve high-stakes data challenges. And yes, with his naked eye, he can tell if your viz is 1 pixel out of alignment.

Zach Bowders is an acclaimed data analyst, recognized as a five-term Tableau Visionary and Ambassador. With over 275 public visualizations, he has earned 12 Viz of the Day honors and two Vizzie Community Awards. A regular Tableau User Group speaker, he has presented at the Tableau Conference and served as a Tableau instructor for Emory University’s “Women in Technology” non-profit program. He shares insights bi-weekly on the Data + Love podcast, exploring data visualization, analytics, and storytelling. 

Prasann Prem is a Tableau Visionary, Social Ambassador, and senior BI engineer at Emirates NBD. A global speaker and mentor, he’s known for simplifying data through impactful storytelling. He founded Tableau Buddy, a platform for guiding beginners via 1:1 mentorship, speaker forums, and a 4-month sandbox program. He also runs Vizdiner, a Tableau learning hub offering free and structured content. With 18k+ LinkedIn followers, Prasann empowers the global community with insights, tools, and mentorship to grow in data visualization.

Join our community on Discord

Join our community’s Discord space for discussions with the authors and other readers:

https://packt.link/ds

Share Your Thoughts

Once you’ve read Learning Tableau 2025_Sixth edition, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Your Book Comes with Exclusive Perks - Here’s How to Unlock Them

Unlock this book’s exclusive benefits now

Scan this QR code or go to packtpub.com/unlock, then search this book by name. Ensure it’s the correct edition.

Note: Keep your purchase invoice ready before you start.

Figure 0.1: Next-Gen Reader, AI Assistant (Beta), and Free PDF access

Enhanced reading experience with our Next-gen Reader:

Multi-device progress sync: Learn from any device with seamless progress sync.

Highlighting and notetaking: Turn your reading into lasting knowledge.

Bookmarking: Revisit your most important learnings anytime.

Dark mode: Focus with minimal eye strain by switching to dark or sepia mode.

Learn smarter using our AI assistant (Beta):

Summarize it: Summarize key sections or an entire chapter.

AI code explainers: In the next-gen Packt Reader, click the Explain button above each code block for AI-powered code explanations.

Note: The AI assistant is part of next-gen Packt Reader and is still in beta.

Learn anytime, anywhere:

Access your content offline with DRM-free PDF and ePub versions—compatible with your favorite e-readers.

Unlock Your Book’s Exclusive Benefits

Your copy of this book comes with the following exclusive benefits:

Next-gen Packt Reader

AI assistant (beta)

DRM-free PDF/ePub downloads

Use the following guide to unlock them if you haven’t already. The process takes just a few minutes and needs to be done only once.

How to unlock these benefits in three easy steps

Step 1

Keep your purchase invoice for this book ready, as you’ll need it in Step 3. If you received a physical invoice, scan it on your phone and have it ready as either a PDF, JPG, or PNG.

For more help on finding your invoice, visit https://www.packtpub.com/unlock-benefits/help.

Note: Did you buy this book directly from Packt? You don’t need an invoice. After completing Step 2, you can jump straight to your exclusive content.

Step 2

Scan this QR code or go to packtpub.com/unlock.

On the page that opens (which will look similar to Figure 0.2 if you’re on desktop), search for this book by name. Make sure you select the correct edition.

Figure 0.2: Packt unlock landing page on desktop

Step 3

Sign in to your Packt account or create a new one for free. Once you’re logged in, upload your invoice. It can be in PDF, PNG, or JPG format and must be no larger than 10 MB. Follow the rest of the instructions on the screen to complete the process.

Note: If you are still facing issues, reach out to [email protected].

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 dataFoundations for building visualizationsVisualizing dataUsing Show MePutting 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 TableauUsing joins, blends, and object model connections in Chapter 13, Understanding the Tableau Data Model, Joins, and BlendsUnderstanding the data structures that work well and how to deal with messy data in Chapter 14, Structuring Messy Data to Work Well in TableauLeveraging 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 paneis 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 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:

From the menu, select File | Exit.When prompted to save the changes, select No.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.

With the existing connection in the starter workbook, 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 about 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.

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. Fields can be dragged from the Data pane onto the canvas area or onto various shelves, such as Rows, Columns, Color, or Size. As we’ll see, 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,which are separated by a line:

Figure 1.4: Dimensions are listed above the line and measures are listed below the line. In data sources with multiple data sources, the list of measures and dimensions is per table.

The difference between Measures and Dimensions is a fundamental concept to understand when using Tableau:

Measures are values that are aggregated. For example, they are summed, averaged, or counted, or the result is the minimum or maximum value.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 (which you can view in the Chapter 01 Starter workbook on the Measures and Dimensions sheet), consider a view created using the Region and Sales fields from the Superstore connection:

Figure 1.5: A bar chart demonstrating the use of measures and dimensions

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 aggregation type (for example, SUM, MIN, MAX, or AVG) will be shown on the active field. Note that, in the preceding example, the active field on Rows clearly indicates the sum aggregation of Sales: SUM(Sales).

The Regionfield 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 sum of sales, the preceding view shows the sum of sales for each region.

Discrete and continuous fields

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 a visual indication of the default value 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. Continuous fields, such as Sales, are green.

Discrete fields

Discrete(blue) fields have values that are shown as distinct and separate from one another. Discrete values can be reordered and still make sense. For example, you could easily rearrange the values of Region to be East, South, West, and Central, instead of the default order in Figure 1.6

When a discrete field is used on the Rows or Columns shelves, the field defines headers. Here, the discrete field Region defines the column headers:

Figure 1.6: The discrete field on Columns defines column headers

Here, it defines the row headers:

Figure 1.7: The discrete field on Rows defines row headers

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

Figure 1.8: The discrete field on Color defines a discrete color palette

Continuous fields

Continuous (green) fields have values that flow from first to last as a continuum. Numeric and date fields are often (though not always) used as continuous fields in the view. The values of these fields have an order that it would make little sense to change.

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

Figure 1.9: The continuous field on Columns (or Rows) defines an axis

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

Figure 1.10: The continuous field on Color defines a gradient color palette

It is very important to note that continuous and discrete are different concepts from measure and dimension. 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 in the view, as shown here:

Figure 1.11: Measures and dimensions can be discrete or continuous

To change the default setting 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 Discrete or Continuous. Alternatively, you can drag and drop the fields between Dimensions and Measures in the Data pane, which will automatically convert the field.

In general, you can think of the differences between the types of fields as follows:

Choosing between a dimension and measure tells Tableau how to slice or aggregate the data.Choosing between discrete and continuous tells Tableau how to display the data with a header or an axis and defines individual colors or a gradient.

As you work through the examples in this book, 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 differences in the visualization. While the concepts of dimensions/measures and discrete/continuous may seem complex for now, with a little practice they will become second nature. And they form the foundation for a solid understanding of how and why Tableau works! Come back to them often. We’ll put this understanding into practice as we turn our attention to visualizing data.

Visualizing data

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

The visualization examples in this section cover a few of the most foundational visualization types. As you work through the examples, keep in mind that 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 about the data and getting answers through iterations of visualization. Tableau is designed to make that process intuitive, rapid, and transparent.

Something that is far more important than memorizing the steps to create a specific chart type is understanding how and why to use Tableau to create a chart and being able to adjust your visualization to gain new insights as you ask new questions.

Bar charts

Bar charts visually represent data in a way that makes the comparison of values 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 onto 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 workbook. The Chapter 01 Complete workbook contains the complete examples so that you can compare your results at any time:

Click on the Sales by Department tab to view that sheet.Drag and drop the Sales field from the Data pane onto the Columns shelf. You now have a bar chart with a single bar representing the sum of sales for all of the data in the data source.

Figure 1.12: Drag and drop Sales from the Data pane to the Columns shelf

Drag and drop the Department field from the Data pane to the Rows shelf. This slices the data to give you three bars, each having a length that corresponds to the sum of sales for each department:

Figure 1.13: The view Sales by Department should look like this when you have completed the preceding steps

You now have a horizontal bar chart. This makes comparing the sales between the departments easy. The marks type drop-down menu on the Marks card is set to Automatic and indicates that Tableau has determined that bars are the best visualization given the fields you have placed in the view. As a dimension, Department slices the data. Being discrete, it defines row headers for each department in the data. As a measure, the Sales field is aggregated. Being continuous, it defines an axis. The mark type of bar causes individual bars for each department to be drawn from 0 to the value of the sum of sales for that department.

Typically, Tableau draws a mark (such as a bar, a circle, or a square) for every combination 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 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 that is defining the axis. Take a moment to experiment with selecting different mark types from the drop-down menu on the Marks card. A solid grasp of how Tableau draws different mark types will help you to 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 the Furniture or Office Supplies department. What if you want to further understand sales amounts for departments across various regions? Follow these two steps:

Navigate to the Bar Chart (two levels) sheet, where you will find an initial view that is identical to the one you created earlier.Drag the Region field from the Data pane to the Rows shelf and drop it to the left of the Department field already in view.

You should now have a view that looks like this:

Figure 1.14: The view, Bar Chart (two levels), should look like this when you have completed the preceding steps

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 can easily compare the sales of 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 has never had the highest sales in any region.

Consider an alternate view, using the same fields arranged differently:

Navigate to the Bar Chart (stacked) sheet, where you will find a view that is identical to the two-level bar chart.Drag the Region field from the Rows shelf and drop it onto the Color shelf:

Figure 1.15: The Bar Chart (stacked) view should look like this

Instead of a side-by-side bar chart, you now have a stacked bar chart. Each segment of the bar is color-coded by 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 are still summed for every combination of Region and Department.

The view level of detail is a key concept when working with Tableau. In most basic visualizations, the combination of values of all 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. For simple views, the number of marks (indicated in the lower-left status bar) corresponds to the number of unique combinations of dimensional values. That is, there will be one mark for each combination of dimension values. Consider how the view level of detail changes based on the fields used in the view: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 per 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 per 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 per unique combination of department and region, and there will be one mark for each combination of department and region.

Stacked bars can be useful when you want to understand part-to-whole relationships. It is now easier 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 the West region, every segment of the bar has a different starting point.

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

Navigate to the Bar Chart (experimentation) sheet.Try dragging the Region field from Color to the other various 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.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):

Figure 1.16: Swap Rows and Columns button

Drag and drop Sales from 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.Experiment further by dragging and dropping other fields onto various shelves. Note the behavior of Tableau for each action you take.From the File menu, select Save.

In the event of a system crash, the Autosave feature should protect your work. The next time you open Tableau, you will be prompted to recover any previously open workbooks that had not been manually saved. You should still develop a habit of saving your work early and often and maintain appropriate backups.

As you continue to explore various iterations, you’ll gain confidence with the flexibility available to visualize your data.

Line charts

Line charts connect related marks in a visualization to show movement or a relationship between those 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 communicate additional information.

The most common kind of line chart is a time series. A time series shows the movement of values over time. Creating one in Tableau requires only a date and a measure.

Continue your analysis of Superstore sales using the Chapter 01 Starter workbook you just saved:

Navigate to the Sales over time sheet.Drag the Sales field from the Data pane to Rows. This gives you a single, vertical bar representing the sum of all sales in the data source.To turn this into a time series, you must introduce a date. Drag the Order Date field from the Data pane to 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:

Figure 1.17: An interim step in creating the final line chart; this shows the sum of sales by year

Throughout the examples in this book, we’ll often refer to using the drop-down menu on a field. You’ll find this menu by right-clicking on a field or by selecting the drop-down indicator that appears as you hover over a field:

Figure 1.18: The drop-down indicator that appears on fields when you hover

Quick tip: Need to see a high-resolution version of this image? Open this book in the next-gen Packt Reader or view it in the PDF/ePub copy.

The next-gen Packt Reader and a free PDF/ePub copy of this book are included with your purchase. Scan the QR code OR go to packtpub.com/unlock, then use the search bar to find this book by name. Double-check the edition shown to make sure you get the right one.

Use the drop-down menu on the YEAR(Order Date) field on Columns (or right-click on the field) and switch the date field to use Quarter. You may notice 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 Beyond Basic Visualizations. For now, select the second option:

Figure 1.19: Select the second Quarter option in the drop-down menu

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

Figure 1.20: Your final view shows sales over each quarter for the last several years

Let’s consider some variations of line charts that allow you to ask and answer even deeper questions.

Iterations of line 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:

Navigate to the Sales over time (overlapping lines) sheet, where you will find a view that is identical to the one you just created.Drag the Region field from the Data pane to Color. Now you have a line per region. Each line is a different color, and a legend indicates which color matches each region. As in the stacked bars example, 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 easy and accurate comparison. It is interesting to note that the cyclical pattern can be observed for each region:

Figure 1.21: This line chart shows the sum of sales by quarter with different colored lines for each region

With only four regions, it’s relatively easy to keep the lines separate. But what about dimensions that have even more distinct values? Let’s consider that case in the following example:

Navigate to the Sales over time (multiple rows) sheet, where you will find a view that is identical to the one you just created.Drag the Category field from the Data pane 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 two or three overlapping lines. But you might also consider using color or size to showcase an important line in the context of the others. Also, note that clicking on an item in the Color legend will highlight the associated line in the view. Highlighting is an effective way to pick out a single item and compare it to all the others.

Drag the Category field from Color on the Marks card and drop it into Rows. You now have a line chart for each category. This enables you to compare each product over time without an overwhelming overlap. You can easily see trends and patterns over time. This is the start of a sparklines visualization that will be developed more fully in Chapter 10, Advanced Visualizations:

Figure 1.22: Your final view should be a series of line charts for each category

The variations in lines for each Category allow you to notice variations in the trends, extremes, and rate of change.

Geographic visualizations

In Tableau, the built-in geographic database recognizes geographic roles for fields such as Country, State, City, Airport, Congressional District, 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 does contain latitude and longitude fields, you may use those instead of the generated values.

Tableau will automatically assign geographic roles to some fields based on a field name and a sampling of values in the data. You can also assign or reassign 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 to see what built-in geographic roles are available.

Figure 1.23: The drop-down menu of a field reveals an option to assign a geographic role

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

Filled mapsSymbol mapsDensity maps

Additionally, Tableau can read spatial files and geometries from some databases and render spatial objects, polygons, and more. We’ll take a look at these and other geospatial capabilities in Chapter 12, Exploring Mapping and Advanced Geospatial Features. For now, we’ll consider some foundational principles for geographic visualization.

Filled maps

Filled maps fill areas such as countries, states, or ZIP codes to show a location. The color that fills the area can be used to communicate measures such as average sales or population, as well as dimensions such as region. These maps are also called choropleth maps.

Let’s say you want to understand sales for Superstore and see whether there are any patterns geographically.

If your regional settings are not set to the US, you may need to use the Edit Locations option to set the country to United States.

You might take an approach like the following:

Navigate to the Sales by State sheet.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. The Automatic mark type is a circle, which is drawn in the geographic center of each state.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 Map:

Figure 1.24: A filled map showing the sum of sales per state

The filled map fills each state with a single color to indicate the relative sum of sales for that 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 in the bottom status bar, 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.

Observe that the map displays 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. We’ll look at how you can customize the map in Chapter 12, Exploring Mapping and Advanced Geospatial Features.

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 the 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 the larger size influences your perception, but would you have guessed Massachusetts? Some locations may be small enough that they won’t even show up compared to larger areas.

Use filled maps with caution and consider pairing them with other visualizations on dashboards for clear communication.

Symbol maps

With symbol maps, marks on the map are not drawn as filled regions; rather, marks are shapes or symbols placed at specific geographic locations. The size, color, and shape may also be used to encode additional dimensions and measures.

Continue your analysis of Superstore sales by following these steps:

Navigate to the Sales by Postal Code sheet.Double-click on Postal Code in the Data pane. Tableau automatically adds Postal Code to Detail on 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.Drag Sales from the Data pane to the Size shelf on the Marks card. This will resize each circle based on the total sales for that postal code.Drag Profit from the Data pane 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, which may require some action.

The final view should look similar to the following (note that some fine-tuned adjustments have been made to the size and color):

Figure 1.25: A symbol map showing the sum of profit (encoded with color) and the sum of sales (encoded with size) per postal code

Sometimes, you’ll want to adjust the marks on a symbol map to make them more visible. Some options include the following:

If the marks are overlapping, click on the Color shelf and set the transparency to somewhere between 50% and 75%. Additionally, add a dark border. This makes the marks stand out, and you can often better discern any overlapping marks.If marks are too small, click on the Size shelf and adjust the slider. You may also double-click on the Size legend and edit the details of how Tableau assigns size.If the 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 result for this example:

Figure 1.26: The Edit Colors dialog includes options for changing the number of steps, reversing, and using the full color range, including totals, as well as advanced options for adjusting the range and center point

Unlike filled maps, symbol maps allow you to use size to visually encode aspects of the data. Symbol maps also allow 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 also allows you to map locations that do not have clearly defined boundaries.

Sometimes, when you manually select Map in the Marks card drop-down menu, you will get an error message indicating that filled maps are not supported at the level of detail in the view. In those cases, Tableau is rendering a geographic location that does not have built-in shapes.

Other than cases where filled maps are not possible, you will need to decide which type best meets your needs. We’ll also consider the possibility of combining filled maps and symbol maps in a single view in later chapters.

Density maps

Density maps show the spread and concentration of values within a geographic area. Instead of individual points or symbols, the marks blend together, showing greater intensity in areas with a high concentration. You can control the Color, Size, and Intensity.

Let’s say you want to understand the geographic concentration of orders. You might create a density map using the following steps:

Navigate to the Density of Orders sheet.Double-click on the Postal Code field in the Data pane. Just as before, Tableau automatically creates a symbol map geographic visualization using the Latitude (generated), Longitude (generated), and State fields.Using the drop-down menu on the Marks card, change the mark type from Automatic to Density. The individual circles now blend together, showing concentrations:

Figure 1.27: A density map showing concentration by postal code

Try experimenting with the Color and Size options. Clicking on Color, for example, reveals some options specific to the Density mark type:

Figure 1.28: Options for adjusting the Color, Intensity, Opacity, and Effects for Density marks

Several color palettes are available that work well for density marks (the default ones work well with light color backgrounds, but there are others designed to work with dark color backgrounds). The Intensity slider allows you to determine how intensely the marks should be drawn based on concentrations. The Opacity slider lets you decide how transparent the marks should be.

This density map displays a high concentration of orders from the east coast. Sometimes, you’ll see patterns that merely reflect population density. In such cases, your analysis may not be particularly meaningful. In this case, the concentration on the East Coast compared to the lack of density on the West Coast is intriguing.

With an understanding of how to use Tableau to visualize your data, let’s turn our attention to a feature that generates some visualizations automatically, Show Me!

Using Show Me

Show Me is a powerful component of Tableau that arranges selected and active fields into the places required for the selected visualization type. The Show Me toolbar displays small thumbnail images of different types of visualizations, allowing you to create visualizations with a single click. Based on the fields you select in the Data pane and the fields that are already in view, Show Me will enable possible visualizations and highlight a recommended visualization.

It does this with visual analytics best practices built in, giving you the ability to quickly see a variety of visualizations that might answer your questions.

Explore the features of Show Me by following these steps:

Navigate to the Show Me sheet.If the Show Me pane is not expanded, click on the Show Me button in the upper right of the toolbar to expand the pane.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 like this:

Figure 1.29: The Show Me interface

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 already in the view, in addition to any selected in the Data pane.

Show Me highlights the recommended visualization for the selected fields and gives a description of what fields are required as you hover over each visualization type. Symbol maps, for example, require one geographic dimension and 0 to 2 measures.

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

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