...
Example data:
TransformsTransformations:
...
trans |
---|
RawWrangle | true |
---|
p03Value | 'add' |
---|
Type | step |
---|
WrangleText | derive type:single value:(X + Y) as: 'add' |
---|
|
...
| p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (X + Y) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'subtract' |
---|
Type | step |
---|
WrangleText | derive type:single value:(X - Y) as: 'subtract' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
|
...
p02Name | Formula |
---|
p02Value | (X - Y) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'multiply' |
---|
Type | step |
---|
WrangleText | derive type:single value:(X * Y) as: 'multiply' |
---|
p01Name | Formula type |
---|
|
...
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (X * Y) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'divide' |
---|
Type | step |
---|
WrangleText | derive type:single value:(X / Y) as: 'divide' |
---|
|
...
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (X / Y) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'modulo' |
---|
Type | step |
---|
WrangleText | derive type:single value:(X % Y) as: 'modulo' |
---|
|
...
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (X % Y) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'power' |
---|
Type | step |
---|
WrangleText | derive type:single value: pow(X,Y) as: 'power' |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | pow(X,Y) |
---|
|
...
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
p03Value | 'negativeXminusY' |
---|
Type | step |
---|
WrangleText | derive type:single value: -(X-Y) as: 'negativeXminusY' |
---|
|
...
| p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | -(X-Y) |
---|
p03Name | New column name |
---|
SearchTerm | New formula |
---|
|
Results:
Your output looks like the following. Below, (null value)
indicates that a null value is generated for the computation.
...
Info |
---|
NOTE: When a numeric operator is applied to a set of values, the type of data of each source value is re-inferred to match any literal values used on the other side of the expression. This method allows for more powerful comparisons. In the following examples, values taken from the MySource column are re-typed to match the inferred data type of the other side of the expression. |
add
Column Type | Example TransformTransformation | Output | Notes |
---|
Integer/Decimal | codetrans |
---|
RawWrangle | true |
---|
Type | step |
---|
WrangleText | derive type:single value:(MySource + 5) |
---|
|
D code | keep row: | p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (MySource + |
---|
| 2. | Generated values are sum of values in MySource column and the constant (5 or 2.5). | |
Datetime | You cannot directly add Datetime values. You can use the DATEDIF function to generate the number of days difference between two date values. See DATEDIF Function. | | |
String | You cannot add strings together. - You can use the
MERGE transform to concatenate columns of string values together. See Merge Transform. - You can use the
ARRAYCONCAT function to concatenate multiple columns of array type together. See ARRAYCONCAT Function.
| | For computational purposes, all data types not previously listed in this table behave like strings. |
subtact
Column Type | Example TransformTransformation | Output | Notes |
---|
Integer/Decimal | codetrans |
---|
RawWrangle | true |
---|
Type | step |
---|
WrangleText | derive type:single value:(MySource - 5) |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value |
---|
| d-code(MySource - 5) | SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
Type | step |
---|
WrangleText | derive type:single value:(MySource - 2.5) |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (MySource - 2.5) |
---|
SearchTerm | New formula |
---|
|
| Generated values are difference between values in MySource column and the constant (5 or 2.5). | |
Datetime | You cannot directly subtract Datetime values. You must use the DATEDIF function to generate the number of days difference between two date values. See DATEDIF Function. | | |
String | You cannot differentiate strings directly. - You can use the
SUBSTRING function to locate one string within the other. If found, this function returns the index of the value in the source string where the substring is located. This index value can used as an input to the LEFT and RIGHT functions to remove the substring. See SUBSTRING Function.
| | For computational purposes, all data types not previously listed in this table behave like strings. |
...
multiply
Column Type | Example TransformTransformation | Output | Notes |
---|
Integer/Decimal | codetrans |
---|
RawWrangle | true |
---|
Type | step |
---|
WrangleText | derive type:single value:(MySource * 5) |
---|
| d-codep01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (MySource * 5) |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
Type | step |
---|
WrangleText | derive type:single value:(MySource * 2.5) |
---|
|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (MySource * 2.5) |
---|
SearchTerm | New formula |
---|
|
| Generated values are the product of values in the MySource column and the constant (5 or 2.5). | |
Datetime | N/A | | |
String | N/A | | |
divide
Column Type | Example TransformTransformation | Output | Notes |
---|
Integer/Decimal | codetrans |
---|
RawWrangle | true |
---|
Type | step |
---|
WrangleText | derive type:single value:(MySource / 5) |
---|
p01Name |
---|
| d-codeFormula type | p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (MySource / 5) |
---|
SearchTerm | New formula |
---|
|
D trans |
---|
RawWrangle | true |
---|
Type | step |
---|
WrangleText | derive type:single value:(MySource / 2.5) |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (MySource / 2.5) |
---|
SearchTerm | New formula |
---|
|
| Generated values are the values in the MySource column divided by the constant (5 or 2.5).
| |
Datetime | N/A | | |
String | N/A | | |
modulo
Column Type | Example TransformTransformation | Output | Notes |
---|
Integer | codetrans |
---|
RawWrangle | true |
---|
Type | step |
---|
WrangleText | derive type:single value:(MySource % 5) |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (MySource % 5) |
---|
SearchTerm | New formula |
---|
|
| Generated values are the values in the MySource column divided by the constant (5 or 2.5).
| |
Decimal | codetrans |
---|
RawWrangle | true |
---|
Type | step |
---|
WrangleText | derive type:single value:(MySource % 2.5) |
---|
p01Name | Formula type |
---|
p01Value | Single row formula |
---|
p02Name | Formula |
---|
p02Value | (MySource % 2.5) |
---|
SearchTerm | New formula |
---|
|
| Not supported. Inputs must be of Integer type. | |
Datetime | N/A | | |
String | N/A | | |
...