Version 2021

Walkthrough to create a simple metric

This procedure walks you through creating the most basic metric, based on the Sum function and a fact. You can use attributes and metrics, as well as other functions and operators, to define a metric. Using the Sum function classifies this metric as a simple metric, rather than a compound metric.

To create a metric

  1. Open the Metric Editor. How?

  2. If the Object Browser (the list of folders and objects) is not displayed, select Object Browser from the View menu.

  3. Use the Object Browser to locate the fact. Double-click it to add it to the metric formula. By default, the Sum function is used for a fact.

    The next step describes how to change the function. If you replace Sum with a non-grouping function or an arithmetic operator, the metric becomes a compound metric. Arithmetic operators are +, -, *, and / while non-grouping functions are OLAP and scalar functions such as Running Sum or Rank. For more details, see Creating compound metrics.

  4. To modify the formula, click Formula to identify the facts to which the metric is applied and the type of aggregation the metric is to have. Enter values for this component as follows:

    • Select operators and delimiters available on the selection bar (( ), +, -, *, and /), as applicable, to define the metric.

    • To delete the metric formula and begin again, click Clear.

    • Click Validate to check the validity of your newly defined metric. The Metric Editor displays the Validation status on the lower-left corner of the Definition window.

    If you create a compound metric, you cannot set the level, conditionality, or transformation components; therefore skip to step 8 below. However, you can set smart subtotals on a compound metric.

  5. By default, the metric is calculated at the report level, meaning that the attributes on the report template dictate how the metric is aggregated. However, you can change the level (dimensionality) of the calculation. How?

  6. By default, the metric does not include a filter, which specifies the requirements that data must meet to be included in report results. You can specify the filter, known as a condition on a metric, to apply to the metric. How?

  7. By default, the metric does not include transformations, or offset values, such as "four months ago". However, you can add transformations. How?

  8. Once you complete the metric definition, select it under Metric New Metric is defined as, then click Validate. The Metric Editor displays a status message, at the bottom of the Definition area, showing whether the new metric definition is correct (Valid expression).

  9. Click Save and Close on the toolbar. The Save As dialog box opens.

  10. Select the folder in which to save the new metric.

  11. Enter the name of the new metric and click Save. You are returned to MicroStrategy Developer.

When naming a MicroStrategy object, you must follow the naming convention rules for your particular database platform. Using a word reserved by your database platform may result in an error. Refer to your database documentation for a list of these database-reserved words.

Related Topics