Calculated fields

A calculated field is an additional data field with values calculated using a formula.
You can use calculated fields to create new dimensions and measures.
The data source remains unchanged.

To write formulas, you can use existing dataset fields, parameters, constants, and functions.

You can create calculated fields in the dataset or wizard interface:

  • Calculated fields from a dataset are available in all charts above this dataset.
  • Calculated fields from the wizard are only available for saved charts.

Calculated fields in datasets

You can add new fields to a dataset field list.

When creating a formula, you can use any dataset field, including the calculated fields that you created earlier.

After creating a calculated field and saving the dataset, the field becomes available to all the charts and dashboard selectors based on that dataset.
To hide fields in the wizard, enable the Don't display option when creating them.

Calculated fields are marked with .

Calculated fields in charts

You can add new fields when creating and editing charts in the wizard:

  • In the list of fields from a dataset.
  • In the visualization section.

When creating a formula, you can use any dataset field, including the calculated fields that you created earlier.

If a field is created in a chart, it will not be available to dashboard selectors and other charts.

Calculated fields are marked with .

Warning

In multi-dataset charts, calculated fields are not applicable to fields from multiple datasets.

Functions

Functions are the principal components used for creating formulas. You can use them to perform various operations on data fields.

The list of available functions depends on the data source. For more information, see Function Availability.

Warning

Avoid calculation loops: in a formula, you can't use a field that uses the same formula to calculate its own value.

Notation format

Write formulas that meet the following requirements:

  1. Function arguments are specified in parentheses. For example, YEAR([DATE1]). Multiple arguments are separated by a comma.
  2. Field names are given in square brackets. For example, [CustomerID].
  3. Make sure to enter the values of fields and constants in a valid format. For example, use a dot as the decimal separator: 0.123.

Note

  • Field name syntax is case-sensitive. For example, if a formula uses [NAME], and a dataset contains only [Name], the formula field will be highlighted in red.
  • Function syntax is not case-sensitive. For instance, count and COUNT will perform the same operation.

Reference information on format, types of arguments accepted, and returned function values is available in the formula editor interface.
To do this, click Reference in the add field interface.

How to create a calculated field

You can create calculated fields in the dataset or wizard interface.

  1. In the left-hand panel, click Datasets and select the dataset you need. If you do not have a dataset, create one.
  2. In the top-right corner, click Add field.
  3. Enter a name for the field.
  4. Select Formula as the data source for the field.
  5. Set the formula using data source functions.
  6. Click Create. The field will appear in the dataset.
  1. Open the wizard.
  2. Select the dataset to create a chart in.
  3. In the left part of the screen, click above the list of dataset fields.
  4. Enter the required formula.
  5. Click Create. The field will appear in the list of fields. You can use it as your chart data source.

See also