46,79 €
Learn how to create effective data visualizations with Tableau and unlock a smarter approach to business analytics. It might just transform your organization
Got data? Not sure what to make of it? This is the guide for you – whether you've been working with Tableau for years or are just beginning your adventure into business analytics.
Tableau has for some time been one of the most popular Business Intelligence and data visualization tools available. Why? Because, quite simply, it's a tool that's responsive to the needs of modern businesses. But it's most effective when you know how to get what you want from it – it might make your business intelligent, but it isn't going to make you intelligent...
We'll make sure you're well prepared to take full advantage of Tableau 10's new features. Whether you're an experienced data analyst that wants to explore 2016's new Tableau, or you're a beginner that wants to expand their skillset and bring a more professional and sharper approach to their organization, we've got you covered. Beginning with the fundamentals, such as data preparation, you'll soon learn how to build and customize your own data visualizations and dashboards, essential for high-level visibility and effective data storytelling. You'll also find out how to so trend analysis and forecasting using clustering and distribution models to inform your analytics.
But it's not just about you – when it comes to data it's all about availability and access. That's why we'll show you how to share your Tableau visualizations. It's only once insights are shared and communicated that you – and your organization – will start making smarter and informed decisions. And really, that's exactly what this guide is for.
Practical yet comprehensive, this Tableau guide takes you from the fundamentals of the tool before diving deeper into creating advanced visualizations. Covering the latest features found in Tableau 10, this might be the guide that transforms your organization.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 392
Veröffentlichungsjahr: 2016
Copyright © 2016 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 be 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.
First published: April 2015
Second edition: September 2016
Production reference: 1260916
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-635-8
www.packtpub.com
Author
Joshua N. Milligan
Copy Editors
Vikrant Phadke
Sneha Singh
Reviewers
Bridget Cogley
Shawn Wallwork
Project Coordinator
Shweta H Birwatkar
Commissioning Editor
Veena Pagare
Proofreader
Safis Editing
Acquisition Editor
Tushar Gupta
Indexer
Mariammal Chettiyar
Content Development Editor
Sumeet Sawant
Graphics
Disha Haria
Technical Editor
Akash Patel
Production Coordinator
Arvindkumar Gupta
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 Joshua hands on experience with 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.com. You can follow Joshua on Twitter at @VizPainter.
I would like to express profound gratitude to the numerous individuals who have helped me in my journey over the years. My father, Stuart, introduced me to the world of computers to me when he showed me that I could make the family computer do anything I wanted with code. I stand on the shoulders of giants. The Tableau training team expanded my horizons. The members of the Tableau community, leaders in the forums, designers, and bloggers continue to broaden my understanding of Tableau and data visualization. Joe Mako, Jonathan Drummey, Ben Jones, and many others have inspired me to press on and never quit learning. I especially would like to express appreciation for the reviewers. Shawn and Bridget provided key insights, critical challenges, and deeply felt encouragement. Thank you also to my wonderful wife, Kara, who has encouraged me and loved me every step of the way!
Bridget Cogley, interpreter turned analyst, first found Tableau in 2010. It was a perfect fit for her analytical mind and artistic nature and rapidly became both a vocation and avocation. Bridget’s background includes training, HR, management, grant writing, RFP response creation, sales support, and data analysis. In 2014, she became a consultant and is now Joshua’s coworker at Teknion Data Solutions.
Bridget is a Tableau Ambassador and Zen Master and blogs at TableauFit.com. Her passion for learning combined with her love of Tableau has led to the creation of many beautiful and insightful dashboards that can be found on her blog. Bridget is also an accomplished speaker and webinar producer, and she actively shares her knowledge of and passion for Tableau frequently through social media and can be followed on Twitter at @WindsCogley.
Bridget is incredibly thankful to Joshua for the opportunity to review this book and wishes it was around when she was learning Tableau. She’s also grateful to her family, friends, and the people that helped make her Tableau career possible.
Shawn Wallwork started using Tableau back in 2011. Now five plus years and three Zen Masters awards later, he is the founder of Remote Tableau Consultants. He works with customers all over the globe, from London to Melbourne, and many points in between. He works either creating Tableau workbooks, or doing one-on-one consulting to help clients better understand how to make Tableau work the way they want it to. As his company name suggests, he does this work remotely from the comfort of his own home in Placitas, New Mexico!
Shawn happily agreed to review Joshua’s book ‘Leaning Tableau 10’, because as a fellow Zen Master, he was confident this would be an in-depth, and accurate book explaining how Tableau works. To be honest the technical review of his book was quite easy, since Joshua has such an in-depth understanding on how Tableau works at the internal, base level.
As a technical reviewer of this book, the only person I want to thank is the Author: Joshua Milligan. He has now written two great books on Tableau! I thank him for allowing me to be a part of his efforts.
As a technical reviewer of this book, the only person I want to thank is the Author: Joshua Milligan. He has now written two great books on Tableau! I thank him for allowing me to be a part of his endeavor.
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.
What is it about a piece of software that inspires a community of users to post pictures of themselves holding signs that say, “I love Tableau”, write books and blogs, and spend countless hours volunteering to help others visualize their data? And how is it that a single tool can be embraced and used by everyone from business users, to data analysts, to CEOs? What is it about Tableau that inspires such passion?
Tableau’s uniqueness comes from its paradigm. Tableau is different from traditional BI products that force you to select a chart type and then match data to various components of the chart. You won’t be confronted with wizards or pre-built dashboards that give you some insight at first but fail to deliver additional insight when you need it. Instead, Tableau allows hands-on interaction with data; it’s easy to get into a flow of asking questions, uncovering new insights, raising new questions and answers, and finally designing a data story to share with others.
And, Tableau is fun! It allows creativity and gives freedom to explore, understand, design, and share. Tableau doesn’t lock you into a single path to a solution. Tableau designers feel like artists with data as paint and Tableau as a blank canvas.
Furthermore, Tableau is easy and powerful. The interface is intuitive and you’ll find yourself exploring data and building visualizations and fully interactive dashboards in minutes (in fact, we’ll do just this in Chapter 1, Creating Your First Visualizations and Dashboard!). But Tableau is also very powerful. It allows you to perform deep and significant analyses of your data. The unique paradigm of Tableau allows this easy and powerful combination.
This book presents the fundamentals for understanding and working within this paradigm. This book will equip you with the concepts and practical application that will allow you to use Tableau to explore, analyze, visualize, and share the stories contained in your data.
Chapter 1, Creating Your First Visualizations and Dashboard, introduces the basic concepts of data visualization and shows multiple examples of individual visualizations that are ultimately put together in an interactive dashboard.
Chapter 2, Working with Data in Tableau, explains that Tableau has a very distinctive paradigm for working with data. This chapter explores that paradigm and gives examples of connecting to and working with various data sources.
Chapter 3, Moving from Foundational to More Advanced Visualizations, expands upon the basic concepts of data visualization to show how to extend standard visualization types.
Chapter 4, Using Row-Level, Aggregate, and Level of Detail Calculations, introduces the concepts of calculated fields and the practical use of calculations. The chapter walks through the foundational concepts for creating Row Level, Aggregate, and Level of Detail calculations.
Chapter 5, Table Calculations, is about table calculations, one of the most complex and most powerful features of Tableau. This chapter breaks down the basics of scope, direction, partitioning, and addressing to help you understand and use them to solve practical problems.
Chapter 6, Formatting a Visualization to Look Great and Work Well, is about formatting, which can make a standard visualization look great, have appeal, and communicate well. This chapter introduces and explains the concepts around formatting in Tableau.
Chapter 7, Telling a Data Story with Dashboards, dives into the details of building dashboards and telling stories with data. It covers the types of dashboards, objectives of dashboards, and concepts such as actions and filters. All of this is done in the context of practical examples.
Chapter 8, Deeper Analysis – Trends, Clustering, Distributions and Forecasting, explores the analytical capabilities of Tableau and demonstrates how to use trend lines, clustering, distributions, and forecasting to dive deeper into the analysis of your data.
Chapter 9, Making Data Work for You, shows that data in the real world isn’t always structured well. This chapter examines the structures that work best and the techniques that can be used to address data that can’t be fixed.
Chapter 10, Advanced Visualizations, Techniques, Tips, and Tricks, builds upon the concepts in previous chapters and expands your horizons by introducing non-standard visualization types along with numerous advanced techniques, while giving practical advice and tips.
Chapter 11, Sharing Your Data Story, once you’ve built your visualizations and dashboards, you’ll want to share them. This chapter explores numerous ways of sharing your stories with others.
You will need a licensed or trial version of Tableau Desktop to follow the examples contained in this book. You may download Tableau Desktop from Tableau Software at http://www.tableau.com/. The examples in this book use the interface and features of Tableau 10.0. Many of the concepts will apply to previous versions, though some interface steps and terminology may vary. The provided workbooks may be opened in Tableau 10.0 or later, though you may use any version to connect to the provided data files to work through the examples.
Tableau Public is also available as a free download (http://www.tableau.com/) and may be used with many of the examples. To follow the examples using Tableau Public, you’ll need to use the workbooks as published to Tableau Public. You will find the published workbooks here: http://goo.gl/wJzfDO.
You may use a PC or a Mac to work through the examples in this book. Mac users may notice slight changes in user interface and will need to make note of the following changes in keys and clicks:
Anyone seeking to understand their data and grow in their skills to visually explore, analyze, and present their data stories to others will greatly benefit from this book. While it is assumed that you have some general knowledge of data, you do not need to have in-depth knowledge of databases, SQL scripts, or coding. The book starts with foundational principles and builds upon those to give you comfort with advanced concepts. The goal is not to give a series of steps to memorize, but to give you a solid understanding of working in the Tableau paradigm. Whether you are just beginning or have years of experience, this book will further you in the journey of learning and even mastering Tableau.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, and user input are shown as follows: "We’ll create a calculated field named Floor to determine if an apartment is upstairs or downstairs."
A block of code is set as follows:
IF [Apartment] >= 1 AND [Apartment] <= 3 THEN "Downstairs" ELSEIF [Apartment] > 3 AND [Apartment] <= 6 THEN "Upstairs" ELSE "Unknown" ENDNew terms and important words are shown in bold. Words that you see in the Tableau interface, such as those in menus, dialog boxes or field names, appear in the text like this: "Drag and drop the Customer field to the Rows shelf."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to [email protected], and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on https://www.packtpub.com/books/info/packt/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Learning-Tableau-10. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
If you are using Tableau Public, you’ll need to locate the workbooks that have been published to Tableau Public. These may be found at the following link: http://goo.gl/wJzfDO.
We also provide you a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from: http://www.packtpub.com/sites/default/files/downloads/LearningTableau10_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at [email protected] with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at [email protected] if you are having a problem with any aspect of the book, and we will do our best to address it.
Tableau is an amazing platform for seeing, understanding, and making key decisions based on your data. With it, you can achieve incredible data discovery, analysis, and storytelling. You'll accomplish these tasks and goals visually using an interface that is designed for a natural and seamless flow of thought and work. Tableau accomplishes this using VizQL, a visual query language. You won't have to learn VizQL. It's all done behind the scenes and you won't be forced to write tedious SQL scripts, 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:
We'll take a look at each of these tasks in the subsequent chapters. This chapter introduces the foundational principals of Tableau and focuses 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. But don't skip this chapter, as it introduces key terminology and foundational concepts, including:
Tableau connects to data stored in a wide variety of files and databases. This includes flat files, such as Excel and text files; relational databases, such as SQL Server and Oracle; cloud-based data sources, such as Google Analytics and Amazon Redshift; and OLAP data sources, such as Microsoft Analysis Services. With very few exceptions, the process of building visualizations and performing analysis will be the same no matter what data source you use. We'll cover the details of connecting to different data sources in Chapter 2, Working with Data in Tableau.
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.
The Chapter 1 workbook, 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:
We'll refer to elements of the interface throughout the book using specific terminology, so take a moment to get familiar with the terms used for various components numbered in the preceding image:
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 view or active fields, because they play an active role in the way Tableau draws the visualization.
A Tableau workbook is the collection of data sources, sheets, dashboards, and stories. All of this is saved as a single Tableau workbook file (.twb or.twbx). We'll look at the difference in file types and explore details of what else is saved as a part of a workbook in later chapters.
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 into building some foundational visualization types. To prepare for this, do the following:
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 of 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.
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 onto the canvas area or onto various shelves, such as Rows, Columns, Color, or Size. We'll see that, placement of the fields will result in different encodings of the data, based on the type of field.
The fields from the data source are visible in the data pane and are divided into measures and dimensions. The difference between measures and dimensions is a fundamental concept to understand when using Tableau:
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 fields Region and Sales from the Superstore connection, as shown here:
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 (such as SUM, MIN, MAX, AVG) will be shown on 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 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.
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.
In the screenshots, in the print version of this book, you should be able to distinguish a slight difference in shading between discrete (green) and continuous (blue) fields, but pay special attention to the interface as you follow along using Tableau. You may also wish to download the color image pack from Packt Publishing. You can click on the link: https://www.packtpub.com/sites/default/files/downloads/LearningTableau10_ColorImages.pdf.
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 column headers:
Here, it 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:
Continuous (green) fields have values that 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, which would make little sense to change.
When used on Rows or Columns, a continuous field defines an axis:
When used for color, a continuous field defines a gradient:
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.
To change the default 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 think of whether a field is continuous or discrete, as telling Tableau, how to display the data (header or axis, single colors or gradient) and measure or dimension, and 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, 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.
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. 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 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 of the data and getting answers through iterations of visualization. Tableau is designed to make that process intuitive, rapid, and transparent. Far more important than memorizing steps to create a bar chart is understanding how and why to use a Tableau to create a bar chart and then adjust your visualization to gain new insights as you ask new questions.
Bar charts visually represent data in a way that makes comparisons of a value across different categories easy. 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 quite 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 the 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 will contain the complete example, so you can compare your results at any time:
You now have a horizontal bar chart. This 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 shows an indication 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 is defining an axis with the length of the bar extending from 0 to the value of the sum of sales for each department.
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 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 dropdown on the Marks card. Having an understanding of how Tableau draws different mark types will help you master the tool.
Using the preceding bar chart, you can easily see that the Technology department has more total sales than either Furniture or Office Supplies, which has fewer total sales compared to any other department. What if you want to further understand sales amounts for departments across various regions?
You still have a horizontal bar chart. But now you've introduced Region as another dimension that 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 has higher sales. Office Supplies never has the highest sales in any region.
Let's take a look at a different view, using the same fields arranged differently:
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 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 is still summed for every combination of region and department.
The Level of Detail or View 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 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 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, take some time to experiment with the bar chart to see what variations you can create: