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

...

If the arrays are of different length, then null values are inserted for combinations where one array is missing a corresponding value.

D s

D s
snippetBasic

Array literal reference example:

ARRAYZIP
d-code-lang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
arrayzip([["A","B","C"],["1","2","3"]] )

arrayzip([["A","B","C"],["1","2","3"]] )

Output: Generates Returns a nested array combining elements from the two source arrays. 

Column reference example:

ARRAYZIP
d-code-lang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
arrayzip([array1,array2]) as:'zippedArray'

arrayzip([array1,array2])

Output: Generates a new zippedArray column containing a Returns a single nested array pairing the elements of the array in the listed order of the arrays.  

D s
snippetSyntax

ARRAYZIP
d-codelang-syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:
arrayzip(array_ref1,array_ref2)

arrayzip(array_ref1,array_ref2)


ArgumentRequired?Data TypeDescription
array_ref1Ystring or arrayName of first column or first array literal to apply to the function
array_ref2Ystring or arrayName of second column or second array literal to apply to the function

D s lang notes

array_ref1, array_ref2

...

D s
snippetExamples

Example - Simple ARRAYZIP exampleARRAYZIP example

Source:

ItemLettersNumerals
Item1["A","B","C"]["1","2","3"]
Item2["D","E","F"]["4","5","6"]
Item3["G","H","I"]["7","8","9"]

TransformTransformation:

d-

...

trans
RawWrangletrue
p03Value'LettersAndNumerals'
Typestep
WrangleTextderive type:single value:

...

arrayzip([Letters,Numerals]) as:'LettersAndNumerals'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuearrayzip([Letters,Numerals])
p03NameNew column name
SearchTermNew formula

Results:

ItemLettersNumeralsLettersAndNumerals
Item1["A","B","C"]["1","2","3"][["A","1"],["B",2"],["C","3"]]
Item2["D","E","F"]["4","5","6"][["F","4"],["G",5"],["H","6"]]
Item3["G","H","I"]["7","8","9"][["G","7"],["H",8"],["I","9"]]

...

Include Page
EXAMPLE - Flatten and Unnest Transforms
EXAMPLE - Flatten and Unnest Transforms

D s also
labelnested