Berserk Docs
Scalar FunctionsOther Functions

next

Returns the value of a column from a row at a given offset after the current row in a serialized row set. A row set is serialized by the sort, top, top-hitters, or serialize operators; order-preserving operators (extend, project, where, ...) keep that property. Only valid in a serialized context.

Syntax

next(column, offset, default_value)

Parameters

Prop

Type

Returns: dynamic

Examples

Example 1

datatable(value:long)[
  1,
  2,
  3,
  4
]
| sort by value asc
| extend next_value = next(value)
value (long)next_value (long)
12
23
34
4null

Example 2

datatable(value:long)[
  1,
  2,
  3,
  4
]
| sort by value asc
| extend next_value = next(value, 2, 0)
value (long)next_value (long)
13
24
30
40

On this page