When the metrics and attributes included with Explore do not meet your needs, you can create your own custom metrics and attributes. In this article, you'll learn about standard calculate metrics and standard calculated attributes. These enable you to create new metrics and attributes using the metrics and attributes included with Explore along with a variety of formulas, mathematical functions, and more.
For a list of all available calculated metrics and attributes, see Calculation types reference. For an introduction to writing formulas, see Getting started with custom metrics and attributes.
This article contains the following sections:
Creating standard calculated metrics
Standard calculated metrics enable you to create completely new metrics to add to your dataset. You can use pre-existing metrics and attributes from your dataset, and functions included with Explore's formula writing language.
IF ([Ticket channel]="Email") THEN [Ticket ID] ENDIF
To create a standard calculated metric
- In query builder, click the calculations icon () on the right sidebar.
- Click Standard calculated metric. The Standard calculated metric page opens.
- In the Name field, type a name for your new metric.
- In the Formula field, use the Fields drop-down list to add existing metrics to your formula, or click Explore's auto-complete suggestion as you type the formula.
- If you want to add functions to your formula, click Add under Functions or click Explore's auto-complete suggestion as you type the formula. 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. The metric is saved to the dataset you currently have loaded.
You can now add this calculated metric to your query. When you click Add in the Metrics panel, you'll find you metric in the Calculated metrics folder.
Creating standard calculated attributes
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 displays metrics and attributes you can use in your standard calculated attribute.
Important: Although you can choose standard calculated metrics from the list, this can lead to inaccurate results and is not supported. Use only the metrics supplied with Explore in your standard calculated attributes.
- Sort like time attribute: If your calculated attribute represents dates, this option places your date values in the correct order.
When you click Add in the Columns, Rows, Explosions, or Filters panels, you'll find your attribute in the Calculated attributes folder.