In the calculations menu (), you can create a variety of calculated, or custom metrics and attributes for your reports. One of the metric types you can use is the standard calculated metric. This enables you to write your own calculations, and add customized metrics or attributes to your dataset. Your calculations can include metrics and attributes already in your query 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
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 a standard calculated metric
- In Query Builder, click the calculations icon () on the right sidebar.
- Click Standard calculated metric.
You will be redirected to the formula editor (see Writing Explore formulas).
- 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 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 Explore functions reference.
- 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, this option places your date values in the correct order.