Create Metrics

Use MAQL to create reusable multidimensional queries that combine multiple facts and attributes.

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:

  1. Select the Metrics tab.

    Metrics tab selected in the main navigation bar at the top of the screen.
  2. Select Create metric.

    The Metric Editor window opens. The following image shows the editor with the corresponding step in the metric creation process highlighted.

    Metric Editor for a new metric with multiple elements highlighted. The metric name field at the top left, the description input below it, the MAQL editor covering the center of the panel, the number format dropdown at the bottom left, and the Save button highlighted in the bottom right corner.
  3. Name your metric.

  4. (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.

  5. Populate the body of the Metric Editor with your MAQL expression.

  6. (Optional) Select the format that numbers should use in the visualization results. For more information, see Format Numbers.

  7. Select Save.

    Your metric saves and appears in the list of available Metrics.

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

To edit a metric in the Metric Editor, follow these steps:

  1. Select the Metrics tab.

    Metrics tab selected in the main navigation bar at the top of the screen.
  2. Select the metric that you want to edit.

    Metrics list showing a metric. Click its row to open the Metric editor.

    The Metric Editor window opens.

    Metric Editor showing the MAQL expression for the metric. In this example, it multiplies price by quantity. The MAQL field is editable and spans most of the dialog. The metric name, ID, and usage count are displayed at the top.
  3. Edit the metric.

  4. 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:

  1. Select the Metrics tab.

    Metrics tab selected in the main navigation bar at the top of the screen.
  2. Open the options(…) menu next to the metric that you want to copy and select Make a copy.

    In the Metrics list, clicking the ellipsis button to the right of the metric you want to copy opens the options menu. The Make a copy option is highlighted in the dropdown.

    The Metric Editor opens with a copy of the selected metric.

  3. (Optional) Edit the metric.

  4. Select Save.

Delete a Metric

To delete a metric in the Metric Editor, follow these steps:

  1. Select the Metrics tab.

    Metrics tab selected in the main navigation bar at the top of the screen.
  2. Open the options(…) menu next to the metric that you want to delete and select Delete.

    In the Metrics list, clicking the ellipsis button to the right of the metric you want to delete opens the options menu. The Delete option is highlighted in the dropdown.
  3. Confirm that you want to Delete the metric.

    Confirmation dialog titled Delete metric. A message warns that the metric will become inaccessible in dashboards and insights. The Delete button is highlighted in red in the lower right corner of the dialog.

    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.

Metric Editor embedded in Analytical Designer. Multiple interface elements are highlighted. The Create metric button at the bottom of the left panel, a pencil icon next to an existing metric listed in the left panel, and the MAQL expression for the metric put in the metrics bucket of a visualization.