From the course: Tableau: Mastering Calculations

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Combining table calculations and aggregated calculations

Combining table calculations and aggregated calculations - Tableau Tutorial

From the course: Tableau: Mastering Calculations

Combining table calculations and aggregated calculations

We can also combine aggregated calculations with table calculations in our formulas. Let's look at a simple example, the deviation from the average. Now, don't confuse this with the standard deviation. The standard deviation measures the amount of variation of a set of values, and you can choose to aggregate this way in the context menu, if that is important to you. But that's not what we want here. Let me show you what I mean. In the introductory video of this chapter, we've already seen that reference lines at their heart are nothing but table calculations. We want to calculate the difference between the sum of quantity and the average sum of quantity that the reference line currently shows. For this, we create a calculation and call it deviation from average quantity. We take the sum of quantity and subtract from it the average sum of quantity. For the average, we use the WINDOW_AVG function. This function returns the average of the expression within the window. The window here is…

Contents