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 r097

D toc

 

Excerpt

Generates an array of all unique elements among one or more arrays.

  • Inputs are column names or array literals.
  • If an element appears twice in one or more arrays, it is listed once in the output array.

D s lang vs sql

D s
snippetBasic

Array literal reference example:

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:arrayunique([["A","B"],["A","C"]])

arrayunique([["A","B"],["A","C"]])


Output:
 Returns a single array:

Code Block
["A","B","C"] 

Single-column reference example:


D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:arrayunique([array1]) as:'unique_Array1'

arrayunique([array1])

Output: Returns a single array of all unique elements in array1 .

Multi-column reference example:

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:arrayunique([array1,array2]) as:'unique_Array2'

arrayunique([array1,array2])

Output: Returns a single array listing all unique elements in array1 and array2 .

D s
snippetSyntax

D lang syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:arrayunique (array_ref1,array_ref2)

arrayunique(array_ref1,array_ref2)


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

D s lang notes

array_ref1, array_ref2

Array literals or names of the array columns whose unique elements you want to derive.

D s
snippetusage

Required?Data TypeExample Value
Yes (at least one)Array literal or column referencemyArray1, myArray2

D s
snippetExamples

Example - Simple unique example

Include Page
EXAMPLE - Nested Functions
EXAMPLE - Nested Functions

D s also
labelnested