Create Metrics
The Metric Editor is a graphical user interface tool for creating your own metrics to use in the Analytical Designer or through the API. The editor uses facts, attributes and attribute labels from your logical data model (LDM), as well as any previously created metrics in your workspace, to help you build MAQL expressions with valid syntax.
Create a Metric
To create a metric in the Metric Editor, follow these steps:
Select the Metrics tab.
Select Create metric.
The Metric Editor window opens. The following image shows the editor with the corresponding step in the metric creation process highlighted.
Name your metric.
Note
By default, the name of the metric will become the metric ID. Once you save the metric, if you want to change the ID, you will need to manually edit the ID. To change the ID, select the current ID and replace the text with a new value.(Optional) Add a description of your metric. You can use markdown to customize format text and add hyperlinks and images to the description. For guide on how to use markdown, see Formatting Options for Rich Text.
Populate the body of the Metric Editor with your MAQL expression.
Note
You can press control+space or CMD+I to open a list of possible keywords, facts, and attributes that you can use to help build your expression.(Optional) Select the format that numbers should use in the visualization results. For more information, see Format Numbers.
Select Save.
Your metric saves and appears in the list of available Metrics.
Note
If the syntax for the expression is invalid, it is not possible to save the metric. Valid syntax does not necessarily mean that the metric will produce usable visualizations. This is because any combination of facts or attributes added to the query and any combination of attributes (either for slicing or for filtering) applied to the metric might not always produce a meaningful result when used together.
Edit a Metric
After you create a metric, you can edit the following information about the metric:
- The metric name
- The metric ID
- The description
- The MAQL expression
- The number format
Important
Before editing a metric, consider the following points:
- If you edit the metric ID, other metrics, visualizations and dashboards referencing the metric will become inaccessible.
- If you edit the MAQL expression or number format in a metric, other metrics, visualizations, and dashboards referencing the metric will use the updated values.
- You can save an existing metric as a new metric to retain the original metric. This avoids complications with other metrics, visualizations, and dashboards referencing the original metric.
To edit a metric in the Metric Editor, follow these steps:
Select the Metrics tab.
Select the metric that you want to edit.
The Metric Editor window opens.
Edit the metric.
Select Save, or Save as new to save your changes as a new metric.
Copy a Metric
To copy a metric in the Metric Editor, follow these steps:
Select the Metrics tab.
Open the options(…) menu next to the metric that you want to copy and select Make a copy.
The Metric Editor opens with a copy of the selected metric.
(Optional) Edit the metric.
Select Save.
Delete a Metric
Important
- Deleted metrics are unrecoverable.
- Existing visualizations, dashboards, and metrics that use the deleted metric will become inaccessible.
To delete a metric in the Metric Editor, follow these steps:
Select the Metrics tab.
Open the options(…) menu next to the metric that you want to delete and select Delete.
Confirm that you want to Delete the metric.
The metric is deleted and removed from the list of metrics.
Metric Editor in Analytical Designer
You can also create, edit or delete metrics in the Analytical Designer by clicking the pencil icon, or the Create metric button to open the Metric Editor window.