In the Calculation engine menu (), you can create a variety of calculated, or custom metrics and attributes. One of the available calculated elements option, is standard calculated. Standard calculated elements allow you to write your own calculations, so you can add customized metrics or attributes to your dataset. Your calculations can include metrics and attributes already in your dataset and functions from Explore's formula writing language.
For a list of all available calculated metrics and attributes, see Calculation types reference.
This article contains the following sections:
Standard calculated metrics
This section will discuss how to create standard calculated metrics. Standard calculated metrics give you the freedom to create completely new metrics to add to your dataset. You can use pre-existing elements from your dataset and functions from Explore's formula writing language. To create standard calculated metrics, you must use the Formula Editor (see Navigating the Formula window).
To create a standard calculated metric
- In the Query Builder, click the Calculation engine menu icon () on the right sidebar.
- Select the Standard calculated metric option.
You will be redirected to the Formula writing window (see Navigating the Formula window).
- If you want to add any metrics or attributes to your formula, choose them from the Select a field drop-down list or select Explore's auto-complete suggestion when manually typing. For more information on including metrics and attributes in your formulas, see Adding metrics and attributes to your formula.
- If you want to add any functions to your formula, click the Add button underneath Functions or select Explore's auto-complete suggestion when manually typing. For more information on adding functions to your formula, see Adding functions. For a full list of all available functions, see Formula writing resources.
- Check Compute separately if your formula is using existing calculated metrics and attributes, and you do not want to affect their calculations.
- Click Save.
You can now add your calculated metric to your query. This metric will also be saved to the connection the query was created from.
Standard calculated attributes
A standard calculated attribute is similar to a standard calculated metric. You can use standard calculated attributes to create new, custom attributes to add to your dataset. Standard calculated attributes can use existing attributes and metrics, as well as functions from Explore's formula writing language.
- Computed from: The drop-down list contains all available attributes you can use as a foundation for your standard calculated attribute. This does not include global variables.
- Sort like time attribute: If your calculated attribute represents dates, Sort like time attribute will place your date values in the correct order.