Skip to main content

Reference Previous Values

Syntax:

previous(InitialValue, [Table.Column])
lag(InitialValue, [Table.Column])

References the previous value within a table. The first argument is the initial value, and if you want to reference the previous result in another column, you can pass its name as the second argument. You can use lag()as an alternative syntax:

Examples

previous($10) + 5% adds $10 to the first row and adds 5% to each subsequent row, taking into account the previous value.

previous(0, Acquired * 5%) forecasts the number of customers who churned based on the previous year's acquired clients and a 5% churn rate.

Example Notebooks