Skip to main content
LAG

Get the value of a specified field from a previous row in the dataset

Updated over 2 weeks ago

Description

The LAG() function returns the value of a specified field from a previous row in the dataset. It is useful for comparing current values to previous ones.

Syntax

LAG(ag)

Output

Varies based on input field type

Variables

  1. arg: the field from which to fetch the previous value.

Example

LAG(Value) with Row Offset 1

ID

Value

LAG

1

10

NULL

2

20

10

3

15

20

4

30

15

5

40

30

Did this answer your question?