Simplifying your business rules with customer calculations

Dashboarding concentrates on representing data in a small space while still getting across key concepts in the data. It is important to use the space effectively. There should be a balance between representing too much information and representing not enough information.

Some people circumvent the issue altogether by avoiding data visualization or perhaps simply not requiring it for their roles. For example, you might run up against individuals who are not interested in the "pretty pictures" and want to see the numbers. How do you combine this requirement with other people's requirements to have a visual representation of the data?

Fortunately, there are a number of ways in which we can use data visualization techniques to convey the message of the data in a table. In itself, a table is a valid data visualization technique because tables are very good at representing detail. In particular environments, such as finance, it is the minute details within the table that make all the difference. In data visualization, we also have to cater to the people who just want the numbers as well as those who have a more visual requirement.

In this recipe, we will create a crosstab that has a custom calculation in it, which allows us to enhance the representation of the data for those who prefer a more visual approach; in addition to this, we'll also provision numbers for those who simply want a table.

In this example, we will use the calculation Index(). This ranks members depending on their value. We can use the ranking calculation in order to restrict our data visualization so that it only shows the top three best performers. This is a concept that is key to many dashboards, and we will look at implementing this element in this recipe.

Getting ready

We will continue to work on the Tableau Chapter 2 workbook and start a new sheet by selecting Ctrl + M.

How to do it...

  1. Open up the Tableau Chapter 2 workbook and duplicate the worksheet called Using Crosstabs Flexibly. Rename it to Custom Calculations.
  2. Click on the Connection_FactInternetSales data view and duplicate the SalesAmount measure by right-clicking on it and selecting Duplicate.
  3. Rename it to Rank and then right-click on it to see a pop-up menu. Select the option called Create Calculated Field. You can see an example in the following screenshot:
    How to do it...
  4. Once you have renamed the Calculated Field to Rank, click on it and choose Edit.
  5. You will see the Calculated Field dialog box; an example of this dialog box is shown in the following screenshot:
    How to do it...
  6. To use this calculation as a rank, simply type Index() in the Formula field.
  7. Fortunately, Tableau provides a helpful guide to show you whether the formula is correct. Here, we can see that the calculation is valid. Once you have typed Index() in, click on OK and you are returned to the main Tableau interface.
  8. Next, change the visualization to a table using the Show Me panel.
  9. Now drag the Rank calculated field to the Columns shelf. You will see that Rank appears as a number with two decimal points. To change the format, simply go back to the Measures pane and right-click on Rank. Under the heading Default Properties, you will see an option specified as Number Format. You can see this in the following screenshot:
    How to do it...
  10. We will change the number format to an integer. When we select Number Format, we get the Default Number Format dialog box.
  11. Select the option Number (Custom), reduce the decimal places down to zero, and then click on OK.
  12. The Rank number will appear as an integer, and our data visualization appears as illustrated in the following screenshot:
    How to do it...

    Now, let's take the scenario whereby we want to display only the top three performers by region.

  13. Simply drag Rank from the Measures pane through to the Filters pane. When you do this, you will get the following dialog box:
    How to do it...

    Make sure you enter the number 3 on the right-hand side rather than 6. Although there are six options, this filter means that Tableau will only display the top three best-selling regions.

You can see the final data visualization in the following screenshot:

How to do it...

How it works…

Tableau offers us many interesting ways to compact the data down to its minimum design while still helping us to show the message of the data. Although the main visualization is very small, it helps us to use this element in a later dashboard because we have packaged a lot of information into a very small space.

The visualization shows the following:

  • Top three performers
  • The third performer is actually below average
  • The overall percentage of sales as a number in order to provide numerical detail as well as some ways of visualizing the data so it provides "at a glance" information too

To summarize, making data tell a story is a challenge, particularly when there is not much space to play with. However, making data tell a story is fun with Tableau.

There's more…

Often, the column names in the data source are not meaningful to business users. They may need to be translated into something that is useful. Fortunately, Tableau allows you to use aliases to translate dimension names into something else.

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

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