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 r092
Excerpt

This example illustrates the comparison functions in

D s product
rtrue
.

 Functions:

D generate list excerpts
pagesLESSTHAN Function,LESSTHANEQUAL Function,EQUAL Function,NOTEQUAL Function,GREATERTHAN Function,GREATERTHANEQUAL Function

Source:

colAcolB
111
210
39
48
57
66
75
84
93
102
111

Transformation:

Add the following transforms to your recipe, one for each comparison function:

D trans
RawWrangletrue
p03Value'lt'
Typestep
WrangleTextderive type:single value:LESSTHAN(colA, colB) as:'lt'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueLESSTHAN(colA, colB)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'lte'
Typestep
WrangleTextderive type:single value:LESSTHANEQUAL(colA, colB) as:'lte'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueLESSTHANEQUAL(colA, colB)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'eq'
Typestep
WrangleTextderive type:single value:EQUAL(colA, colB) as:'eq'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueEQUAL(colA, colB)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'neq'
Typestep
WrangleTextderive type:single value:NOTEQUAL(colA, colB) as:'neq'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueNOTEQUAL(colA, colB)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'gt'
Typestep
WrangleTextderive type:single value:GREATERTHAN(colA, colB) as:'gt'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueGREATERTHAN(colA, colB)
p03NameNew column name
SearchTermNew formula

D trans
RawWrangletrue
p03Value'gte'
Typestep
WrangleTextderive type:single value:GREATERTHANEQUAL(colA, colB) as:'gte'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueGREATERTHANEQUAL(colA, colB)
p03NameNew column name
SearchTermNew formula

Results:

colAcolBgtegtneqeqltelt
111falsefalsetruefalsetruetrue
210falsefalsetruefalsetruetrue
39falsefalsetruefalsetruetrue
48falsefalsetruefalsetruetrue
57falsefalsetruefalsetruetrue
66truefalsefalsetruetruefalse
75truetruetruefalsefalsefalse
84truetruetruefalsefalsefalse
93truetruetruefalsefalsefalse
102truetruetruefalsefalsefalse
111truetruetruefalsefalsefalse

D s also
labelexample_comparison_functions1