10. RUNNING Functions


Running functions are a family of functions that manipulate data preceding the current data point. Although not as popular as the window functions, both RUNNING_SUM and RUNNING_AVG can create insightful visualizations.

To explore more Kubicle data literacy subjects, please refer to our full library.


RUNNING functions

- Enable you to perform calculations on all the data points prior to the current data point shown in the view
- Typically used for showing cumulative growth over time with RUNNING_SUM
- Most popular functions within this family are:


In an earlier lesson, we used a quick table calculation to perform a Running Sum by hitting the dropdown and going to running total.

If we double-click on this pill we'll see the formula for this calculation and you'll see a function called Running Sum created this particular chart.

Like Window Sum, Running Sum is part of a family of running functions, such as running max, running average and running min.

any of which can be used in our formulas.

Unlike Window Sum, which applies the calculation to all values available in the window running sum only applies the calculation to data points that have preceded the current data point Let me show you how this works with a simple example using running average.

I'll duplicate the sheet by right-click and duplicate.

I'll then move to a text table and swap and currently I have sum of sales for each month Let's change this formula, and I'll change it to the running average And next to the running average I'll include the sum of sales And to make this easier to read I'll extend the table with fit width.

From the column, you might understand how the running average calculation is working.

For each running average calculation the average is found by taking the average of all the preceding sales. So, for the running average in April 2012 I simply calculate the average monthly sales from January to April to get this answer.

Off camera I have added running max to our table and as you can see, running max only changes when a new monthly sales record is broken Let's now plot running average and running max against each other on a chart.

So, I'll go to show me, and select a line chart and I'll remove sum of sales.

And to show both of these lines on the same chart I'll right-click dual axis, and then synchronize axis And as you can see, overtime the running max deviates significantly from the running average and this is because a couple of products are growing very quickly in the later months that pushes the distance between running max and average well beyond where it was previously In truth, I don't tend to use, the running functions half as often as I do the window functions But running sum and running average can give you some insights in cases where you want to plot market share or distance from the average overtime.

It's worth experimenting with these functions a little more but bear in mind that window sum and the window family functions will be used much more often.

Formulas in Tableau
Formulas in Tableau Part 1


My Notes

You can take notes as you view lessons.

Sign in or start a free trial to avail of this feature.

Free Trial

Download our training resources while you learn.

Sign in or start a free trial to avail of this feature.

Free Trial