INDEX_MULTI

All functions > ARRAY OF ROWS > INDEX_MULTI

Returns an index multi computed from the given array and key.

Signatures

Returns: Map from key values to arrays of positions (1-based)

INDEX_MULTI(base: ARRAY<ROW<T>>, key: FIELD) → INDEX
sql
ParameterTypeRequiredDescription
baseARRAY<ROW<T>>YesArray of rows to index
keyFIELDYesField name to use as lookup key

Notes

  • Creates a multi-valued index mapping key values to arrays of positions
  • Each key maps to an array of all positions with that key value
  • Returns 1-based array indices sorted by position
  • NULL keys are excluded from the index
  • Useful for one-to-many lookups with ELEMENTS_AT_KEY
  • Preserves all occurrences of duplicate keys
  • Use INDEX_UNIQUE for keys with single values
Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19