Introduction
The LAG function helps you look at the value from the previous row in a table. It is useful when you want to compare current data with past data in a list.
To find the difference between sales of this month and the previous month.
To compare a student's current test score with their previous test score.
To check if a stock price went up or down compared to the last day.
To see how a value changes over time in a list of events.