Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

...

Array literal reference example:

ARRAYSTOMAP
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
arraystomap(["A","B"],["1","2","3"] ) as:'myMap'

arraystomap(["A","B"],["1","2","3"])

Output:

...

Returns an Object associating keys from the first array with values from the second array.

Column reference example:

ARRAYSTOMAP
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
arraystomap(array1,array2, 'extraProps') as:'array2mapped'

arraystomap(array1,array2, 'extraProps')

Output:

...

 Returns an Object pairing the elements of the arrays as key-value pairs. Any extra values in array2 are assigned to the extraProps key.

Function reference example:

ARRAYSTOMAP
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
arraystomap(array1,concat([array2,array3])) as:'array2map'

...

arraystomap(array1,concat([array2,array3]))

Output: Returns an Object pairing the elements of array1 and the array created by concatenating array2 and array3.

D s
snippetSyntax

ARRAYSTOMAP
d-codelang-syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:
arraystomap(array_keys,array_values, ['DEFAULT KEY'])

arraystomap(array_keys,array_values, ['DEFAULT KEY'])


ArgumentRequired?Data TypeDescription
array_keysYstring or arrayName of column, array literal, or function returning an array whose elements are the keys for the generated Object
array_valuesYstring or arrayName of column, array literal, or function returning an array whose elements are the values for the generated Object
DEFAULT_KEYNstring literalAny extra values are assigned to this specified key

...