Example Lag Aggregate Formula

What your code might look like:

lag(sum(if("Deals"."Stage" LIKE 'Closed Won',"Deals"."Deal Size",0)),1)

This could then help you have create a formula column within your Pivot table to show the difference between a month’s sales and the previous month.

You might point out that this can be done in a Pivot table as well. However, anything more complex is much easier with an aggregate formula (think, calculate the average of the previous 3 months’ sales, add up the previous 3 months, etc.).

Back to Lesson