Formula¶
The "formula"
transform uses an expression to calculate
and add a new field to the data objects.
Parameters¶
as
Required- The (new) field where the computed value is written to
expr
Required- An expression string
Example¶
Given the following data:
x | y |
---|---|
1 | 2 |
3 | 4 |
... and configuration:
{
"type": "formula",
"expr": "datum.x + datum.y",
"as": "z"
}
A new field is added:
x | y | z |
---|---|---|
1 | 2 | 3 |
3 | 4 | 7 |