Excerpt |
---|
This example illustrates how to use the nested functions. |
Functions:
D generate list excerpts |
---|
pages | ARRAYCONCAT Function,ARRAYINTERSECT Function,ARRAYCROSS Function,ARRAYUNIQUE Function |
---|
|
Source:
Code formatting has been applied to improve legibility.
Item | ArrayA | ArrayB |
---|
Item1 | ["A","B","C"] | ["1","2","3"] |
Item2 | ["A","B"] | ["A","B","C"] |
Item3 | ["D","E","F"] | ["4","5","6"] |
Transformation:
You can apply the following transforms in the following order. Note that the column names must be different from the transform name, which is a reserved word.
D trans |
---|
RawWrangle | true |
---|
p03Value | 'concat2' |
---|
Type | step |
---|
WrangleText | derive type:single value:ARRAYCONCAT([Letters,Numerals]) as:'concat2' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | ARRAYCONCAT([Letters,Numerals]) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'intersection2' |
---|
Type | step |
---|
WrangleText | derive type:single value:ARRAYINTERSECT([Letters,Numerals]) as:'intersection2' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | ARRAYINTERSECT([Letters,Numerals]) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'cross2' |
---|
Type | step |
---|
WrangleText | derive type:single value:ARRAYCROSS([Letters,Numerals]) as:'cross2' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | ARRAYCROSS([Letters,Numerals]) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'unique2' |
---|
Type | step |
---|
WrangleText | derive type:single value:ARRAYUNIQUE([Letters,Numerals]) as:'unique2' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | ARRAYUNIQUE([Letters,Numerals]) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Results:
For display purposes, the results table has been broken down into three separate sets of columns.
Column set 1:
Item | ArrayA | ArrayB | concat2 | intersection2 |
---|
Item1 | | ["1","2","3"] | ["A","B","C","1","2","3"] | [ ] |
Item2 | ["A","B"] | ["A","B","C"] | ["A","B","A","B","C"] | ["A","B"] |
Item3 | ["D","E","F"] | ["4","5","6"] | ["D","E","F","4","5","6"] | [ ] |
Column set 2:
Item | cross2 |
---|
Item1 | [["A","1"],["A","2"],["A","3"],["B","1"],["B","2"],["B","3"],["C","1"],["C","2"],["C","3"]] |
Item2 | [["A","A"],["A","B"],["A","C"],["B","A"],["B","B"],["B","C"]] |
Item3 | [["D","4"],["D","5"],["D","6"],["E","4"],["E","5"],["E","6"], ["F","4"],["F","5"],["F","6"]] |
Column set 3:
Item | unique2 |
---|
Item1 | ["A","B","C","1","2","3"] |
Item2 | ["A","B","C"] |
Item3 | ["D","E","F","4","5","6"] |
D s also |
---|
label | example_nested_functions |
---|
|