ROWVECTOR

ROWVECTOR()[source]

Generates a row position indicator vector for the current table context.

ROWVECTOR creates a sparse integer array where a single element is set to 1 at the current row index, and all other elements are 0. If no table context is available, it returns an empty array.

Returns:

  • Length matches the number of rows in the current table context

  • Element at the current row index is 1

  • All other elements are 0

  • Returns an empty array if no table context is available

Supported types:

  • INTEGER_ARRAY

Return type:

Formula

Examples

Basic usage within a table context:

# In a 4-row table, evaluating on row 2
ROWVECTOR()
# Returns [0, 1, 0, 0]

No table context:

ROWVECTOR()
# Returns []