Using cross-tabs flexibly

When we create dashboards, we are conveying a unified message of data that can be made up of moving parts. The context of the data can help to ensure that data pieces move together and are consistent with one another. This can mean that showing an aggregated number is not the most meaningful form of data. Instead, percentages or differences can be more meaningful.

In Tableau, we can create very simple calculations using table calculations. What is a table calculation? Table calculations are easy calculations that are provided by default as part of the Tableau interface. Table calculations are quick to create and are a powerful tool that can help to enhance your understanding of the data. From a dashboard perspective, we need to maximize the amount of information in a small space, and table calculations will help you to compress the message of the data while helping the data to be meaningful.

In this recipe, we will create a table calculation and see how it adds to the comprehension of the data in a small space. In this recipe, we will create a chart that shows the percentage of sales attributed to each region, rather than the number.

Getting ready

Open up the Tableau Chapter 2 workbook and start a new sheet by selecting Ctrl + M.

How to do it...

  1. To do this, go to the DimGeography dimension in the Dimensions pane, select the CountryRegionCode member, and place it on the Rows shelf.
  2. Then, go to FactInternetSales in the Dimensions pane, select SalesAmount, and drag it to the Columns shelf.
  3. Right-click on the SalesAmount blue pill on the Columns shelf and navigate to Quick Table Calculation. You can see the following menu item appear:
    How to do it...
  4. For our example, we will choose Percent of Total. The SalesAmount figure will change, and you will see a small triangle appear on the right-hand side. This feature is illustrated as follows:
    How to do it...
  5. Take the SalesAboveOrBelow Average calculation we created earlier and place it in the Color section.
  6. For the visualization, choose a horizontal bar chart from the Show Me panel. Your screen should be the same as the following screenshot:
    How to do it...
  7. Now, it is important to note that the x axis labeling has changed to show % of Total SalesAmount. This is more accurate, but how could we make it more obvious to the data consumer that they are in fact looking at percentages without cluttering the "real estate" on the dashboard? We will look at these steps next.
  8. We can set up a variation on a heat map. From the Show Me shelf, select the heatmap option.
  9. We will use a label to convey the percentage. To do this, take SalesAmount from the Measures pane and drag it to the Label option. Make sure that you change the calculation so that it uses the Percentage of Total option, as we did previously in this recipe. The label will now read the percentage of the total rather than the actual value.
  10. Then, go back to the Marks shelf and select the drop-down list so that it shows Circle; after this, space the heat map so that it looks more even. The following is an example of the resulting chart:

    How to do it...

To summarize, the data is shown in a very compressed way, which provides details as well as a visual message about the data in question. It's clear that the US and Australia regions have above average sales; if more detail is required, the percentages are also given.

How it works...

Tableau allows us to tell a story simply in a small space! The use of table calculations is a very simple way to enhance the data, both visually and also in terms of details. Sometimes, however, using the default table calculations are not enough to meet the business needs and custom calculations are required. This is the subject of our next recipe.

There's more...

The author of the Le Petit Prince books, Antoine de Saint-Exupéry, was once quoted as saying the following:

"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."

The simplicity of a design is often an asset in data visualization, and is better than adding more detail that deviates from the purpose of data visualization.

Edward Tufte coined a term called chartjunk, which he defined as follows:

"Chartjunk refers to all visual elements in charts and graphs that are not necessary to comprehend the information represented on the graph, or that distract the viewer from this information."

This is an important aspect of data visualization. When we are creating dashboards, we have to be careful about adding nonessential items. This is particularly important in situations where we have a small screen space, such as a dashboard or a mobile device.

Table calculations are useful because they help us maximize the space on the screen by providing more enhanced information and encoding business rules effectively. They help us get across essential business information, which is key to the visualization. If you are interested in reading more about chartjunk, it is recommended that you read The Visual Display of Quantitative Information, Edward Tufte (1983).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset