pivot_array

Description

Converts an array of “key”-“value” pairs into an object with key-value attributes.

Return type

object

Domain

This is a scalar function (calculates a single output value for a single input row.)

Categories

Usage

pivot_array(array, keyFieldName, valueFieldName)

Argument

Type

Optional

Repeatable

Restrictions

array

array

no

no

none

keyFieldName

string

no

no

none

valueFieldName

string

no

no

none

Examples

pivot_array(array(FIELD.foo), "key", "value")

Converts ‘[{“key”: “k1”, “value”: “v1”} {“key”: “k2”, “value”: “v2”}, …]’ in column values to ‘{“k1”: “v1”, “k2”: “v2”, …}’

Aliases

array_pivot (deprecated)