Lead/Lag
Lead/Lag allows the user to determine a value from a preceding or following row at a given offset within a group (or partition) of values. This component uses the following:
Properties
Name
= string
A human-readable name for the component.
Include Input Columns
= boolean
When Yes, the component passes all input columns into the output.
Partition Data
= dual listbox
Defines how the input data is partitioned to perform the rank calculation. The calculation is then performed on each partition.
Orderings Within Partitions
= column editor
- Input Column: The input column name for sorting within the partitioned data. You can drag columns to reorder them.
- Ordering: The order of the sorting: Ascending, Descending, Nulls first, or Nulls Last.
Functions
= column editor
- Window Function:
- Lead: Returns the column from
rows earlier in the partition. For more information, read the following documentation: - Lag: Returns the column from
rows later in the partition. For more information, read the following documentation:
- Lead: Returns the column from
- Input Column: The name of the input column that the lead/lag function will return.
- Offset: The number of rows to go forward (lead) or backwards (lag) in the partition.
- Output Column: The name of the output column that the window function will create.
Ingore Nulls
= boolean
When Yes, disregard null values when determining which row to use. Null values don't count toward reaching the offset.
Snowflake | Databricks | Amazon Redshift |
---|---|---|
✅ | ✅ | ✅ |