This example demonstrate the following numeric functions:
Source:
Transformation:
Execute the following transformation steps:
D trans |
---|
RawWrangle | true |
---|
p03Value | 'add' |
---|
Type | step |
---|
WrangleText | derive type:single value:ADD(ValueA, ValueB) as:'add' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | ADD(ValueA, ValueB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'subtract' |
---|
Type | step |
---|
WrangleText | derive type:single value:SUBTRACT(ValueA, ValueB) as:'subtract' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | SUBTRACT(ValueA, ValueB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'multiply' |
---|
Type | step |
---|
WrangleText | derive type:single value:MULTIPLY(ValueA, ValueB) as:'multiply' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | MULTIPLY(ValueA, ValueB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'divide' |
---|
Type | step |
---|
WrangleText | derive type:single value:DIVIDE(ValueA, ValueB) as:'divide' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | DIVIDE(ValueA, ValueB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'mod' |
---|
Type | step |
---|
WrangleText | derive type:single value:MOD(ValueA, ValueB) as:'mod' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | MOD(ValueA, ValueB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'negativeA' |
---|
Type | step |
---|
WrangleText | derive type:single value:NEGATE(ValueA) as:'negativeA' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | NEGATE(ValueA) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'lcm' |
---|
Type | step |
---|
WrangleText | derive type:single value:LCM(ValueA, ValueB) as:'lcm' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | LCM(ValueA, ValueB) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Results:
With a bit of cleanup, your dataset results might look like the following:
ValueA | ValueB | lcm | negativeA | mod | divide | multiply | subtract | add |
---|
8 | 2 | 8 | -8 | 0 | 4 | 16 | 6 | 10 |
10 | 4 | 20 | -10 | 2 | 2.5 | 40 | 6 | 14 |
15 | 10 | 30 | -15 | 5 | 1.5 | 150 | 5 | 25 |
5 | 6 | 30 | -5 | 5 | 0.833333333 | 30 | -1 | 11 |