Using Row-Level, Aggregate, and Level of Detail Calculations

One of the most incredible things about Tableau is that it is intuitive to use. We have already seen what amazing discovery, analysis, and data storytelling is possible in Tableau by simply connecting to data and dragging and dropping fields. As we'll see, Tableau allows much more depth beyond simple drag and drop.

Calculations significantly extend the possibilities for analysis, design, and interactivity in Tableau. In this chapter, we'll see how calculations can be used in many ways. We will examine how calculations can be used to fix common problems with data, extend the data by adding new dimensions and measures, and provide additional flexibility in interactivity.

At the same time, while calculations provide additional power and flexibility, they also introduce a level of complexity and sophistication. As you work through this chapter, try to understand the key concepts behind calculations and how they work in Tableau. As usual, follow along with the examples, but feel free to explore and experiment. The goal is not to merely have a list of calculations you can copy, but to gain knowledge of how calculations can be used to solve problems and add creative functionality to your views and dashboards.

The first half of the chapter focuses on some foundational concepts, while the second half gives quite a few practical examples. The topics we'll examine include:

  • Creating and editing calculations
  • Overview of the three main types of calculations
  • Level of Detail calculations
  • Parameters
  • Practical examples
  • Ad hoc calculations
  • Performance considerations

We'll examine table calculations in the next chapter.

Most of the examples in this chapter will use the following dataset. It's simple and small so that we can easily see how the calculations are being done. This dataset is included as Apartment Rentals.xlsx in the Learning TableauChapter 04 directory of the book resources and is also included in the Chapter 4 workbook as a data source named Apartment Rentals:

Apartment Occupant first name Occupant last name Start date End date Area Price
A-1 Dwight Moody May 01 Dec 31 1000 2000
A-2 Mary Slessor Aug 01 Dec 02 800 1600
A-3 Charles Ryrie Feb 16 Mar 02 1200 800
A-4 Hudson Taylor May 21 June 03 1500 1500
B-1 Amy Carmichael Jan 18 Sep 18 3000 3000
B-2 John Walvoord May 01 Dec 20 800 2400

 

The dataset describes six apartments, the occupant, the start and end dates of the rental period, the area (in square feet), and the monthly rental price.

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

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