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.
Array literal reference example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive type:single value:arrayunique([["A","B"],["A","C"]]) |
---|
|
arrayunique([["A","B"],["A","C"]]) |
Output: Returns a single array:
Single-column reference example:
D lang syntax |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive 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 |
---|
RawWrangle | true |
---|
Type | ref |
---|
showNote | true |
---|
WrangleText | derive 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 lang syntax |
---|
RawWrangle | true |
---|
Type | syntax |
---|
showNote | true |
---|
WrangleText | derive type:single value:arrayunique (array_ref1,array_ref2) |
---|
|
arrayunique(array_ref1,array_ref2) |
Argument | Required? | Data Type | Description |
---|
array_ref1 | Y | string or array | Name of first column or first array literal to apply to the function |
array_ref2 | N | string or array | Name of second column or second array literal to apply to the function |
array_ref1, array_ref2
Array literals or names of the array columns whose unique elements you want to derive.
Required? | Data Type | Example Value |
---|
Yes (at least one) | Array literal or column reference | myArray1 , myArray2 |
Example - Simple unique example
Include Page |
---|
| EXAMPLE - Nested Functions |
---|
| EXAMPLE - Nested Functions |
---|
|