Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Tableau 10 Complete Reference

You're reading from   Tableau 10 Complete Reference Transform your business with rich data visualizations and interactive dashboards with Tableau 10

Arrow left icon
Product type Course
Published in Dec 2018
Publisher Packt
ISBN-13 9781789957082
Length 496 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Joshua N. Milligan Joshua N. Milligan
Author Profile Icon Joshua N. Milligan
Joshua N. Milligan
Tristan Guillevin Tristan Guillevin
Author Profile Icon Tristan Guillevin
Tristan Guillevin
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Title Page
About Packt
Contributors
Preface
1. Creating Your First Visualizations and Dashboard 2. Working with Data in Tableau FREE CHAPTER 3. Moving from Foundational to More Advanced Visualizations 4. Using Row-Level, Aggregate, and Level of Detail Calculations 5. Table Calculations 6. Formatting a Visualization to Look Great and Work Well 7. Telling a Data Story with Dashboards 8. Deeper Analysis - Trends, Clustering, Distributions, and Forecasting 9. Making Data Work for You 10. Advanced Visualizations, Techniques, Tips, and Tricks 11. Sharing Your Data Story 12. Catching Up with Tableau 2018 13. Deal with Security 14. How to Keep Growing Your Skills 1. Other Books You May Enjoy Index

Creating bar charts


Bar charts visually represent data in a way that makes comparisons of 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:

  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. 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.

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 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.

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, which has fewer 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 shown:

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:

  1. Navigate to the Bar Chart (stacked) sheet where you will find an initial view identical to the one you created previously.
  2. 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 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.

Note

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:

  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 onto 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 of this book, Tableau does not have an autosave 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.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image