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 |
Required |
Multiple |
Constant |
---|---|---|---|---|
array |
array |
Required |
Only one |
Variable |
keyFieldName |
string |
Required |
Only one |
Variable |
valueFieldName |
string |
Required |
Only one |
Variable |
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)