Calculate Transform

Edit this page

The formula transform extends data objects with new fields (columns) according to a calculation formula.

{
  ...
  "transform": [
    {"calculate": ..., "as" ...} // Calculate Transform
     ...
  ],
  ...
}
Property Type Description
calculate String

Required. A string containing a Vega Expression. Use the variable datum to refer to the current data object.

as String

Required. The field for storing the computed formula value.

Example

This example use calculate to derive a new field, then filter data based on the new field.