This simple example demonstrate available comparison functions:
Source:
colA | colB |
---|
1 | 11 |
2 | 10 |
3 | 9 |
4 | 8 |
5 | 7 |
6 | 6 |
7 | 5 |
8 | 4 |
9 | 3 |
10 | 2 |
11 | 1 |
Transformation:
Add the following transforms to your recipe, one for each comparison function:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'lt' |
---|
Type | step |
---|
WrangleText | derive type:single value:LESSTHAN(colA, colB) as:'lt' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | LESSTHAN(colA, colB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'lte' |
---|
Type | step |
---|
WrangleText | derive type:single value:LESSTHANEQUAL(colA, colB) as:'lte' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | LESSTHANEQUAL(colA, colB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'eq' |
---|
Type | step |
---|
WrangleText | derive type:single value:EQUAL(colA, colB) as:'eq' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | EQUAL(colA, colB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'neq' |
---|
Type | step |
---|
WrangleText | derive type:single value:NOTEQUAL(colA, colB) as:'neq' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | NOTEQUAL(colA, colB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'gt' |
---|
Type | step |
---|
WrangleText | derive type:single value:GREATERTHAN(colA, colB) as:'gt' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | GREATERTHAN(colA, colB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'gte' |
---|
Type | step |
---|
WrangleText | derive type:single value:GREATERTHANEQUAL(colA, colB) as:'gte' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | GREATERTHANEQUAL(colA, colB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Results:
colA | colB | gte | gt | neq | eq | lte | lt |
---|
1 | 11 | false | false | true | false | true | true |
2 | 10 | false | false | true | false | true | true |
3 | 9 | false | false | true | false | true | true |
4 | 8 | false | false | true | false | true | true |
5 | 7 | false | false | true | false | true | true |
6 | 6 | true | false | false | true | true | false |
7 | 5 | true | true | true | false | false | false |
8 | 4 | true | true | true | false | false | false |
9 | 3 | true | true | true | false | false | false |
10 | 2 | true | true | true | false | false | false |
11 | 1 | true | true | true | false | false | false |