EXAMPLE - Comparison Functions1
This example illustrates the comparison functions in Dataprep by Trifacta.
Functions:
Item | Description |
---|---|
LESSTHAN Function | Returns |
LESSTHANEQUAL Function | Returns |
EQUAL Function | Returns |
NOTEQUAL Function | Returns |
GREATERTHAN Function | Returns |
GREATERTHANEQUAL Function | Returns |
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:
Transformation Name |
|
---|---|
Parameter: Formula type | Single row formula |
Parameter: Formula | LESSTHAN(colA, colB) |
Parameter: New column name | 'lt' |
Transformation Name |
|
---|---|
Parameter: Formula type | Single row formula |
Parameter: Formula | LESSTHANEQUAL(colA, colB) |
Parameter: New column name | 'lte' |
Transformation Name |
|
---|---|
Parameter: Formula type | Single row formula |
Parameter: Formula | EQUAL(colA, colB) |
Parameter: New column name | 'eq' |
Transformation Name |
|
---|---|
Parameter: Formula type | Single row formula |
Parameter: Formula | NOTEQUAL(colA, colB) |
Parameter: New column name | 'neq' |
Transformation Name |
|
---|---|
Parameter: Formula type | Single row formula |
Parameter: Formula | GREATERTHAN(colA, colB) |
Parameter: New column name | 'gt' |
Transformation Name |
|
---|---|
Parameter: Formula type | Single row formula |
Parameter: Formula | GREATERTHANEQUAL(colA, colB) |
Parameter: New column name | 'gte' |
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 |