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:

ARRAYELEMENTAT
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
arrayelementat([A,B,C,D],2)

arrayelementat([A,B,C,D],2)

Output: Returns the third value in the array, which is C

Column reference example:

ARRAYELEMENTAT
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
arrayelementat(myArrays,9) as:'10th_myArrays'

arrayelementat(myArrays,9)


Output:
 Generates the new 10th_myArrays column containing the  Returns the tenth element of the arrays listed in the myArrays column.

Array function example:

...

ARRAYELEMENTATCONCAT
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
arrayelementat(
concat([colA,colB]),3) as:'strArrayElementAtIndex'

...

arrayelementat(concat([colA,colB]),3)

Output: Returns the fourth element of the concatenated array

D s
snippetSyntax

ARRAYELEMENTAT
d-codelang-syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:
arrayelementat(array_ref,int_index_ref)

arrayelementat(array_ref,int_index_ref)


ArgumentRequired?Data TypeDescription
array_refYstringName of Array column, Array literal, or function returning an Array to apply to the function
int_index_refYinteger (non-negative)

Index value for the array element to return. Value can be Integer literal, column containing Integer values, or function returning an Integer.

...