lead

The value option offset rows later (default 1).

WindowDeterministic

Flags

Flag Value
Kind window
Nulls nulls are skipped
Deterministic yes
Order matters yes
Decomposable no

Example

A pipeline from the language's tested corpus that uses lead, over the example tables.

Hint
from orders
window {prev = lag(amount), next2 = lead(amount, offset: 2)} by:{customer} order:{placed}

In a plan:

JSON
{
  "args": [
    {
      "col": 2
    }
  ],
  "fn": "lead",
  "options": {
    "offset": 2
  }
}