MicroStrategy ONE
Creating a metric
You create a metric using the Metric Editor. You can also use the Metric Editor to modify an existing metric. For an image of the Metric Editor, see Viewing and working with metrics: The Function Editor.
When you create a metric, you define its formula, enable a total or subtotal if you want, and determine a function for dynamic aggregation. The following steps walk you through this process in the Metric Editor.
After you create a metric, you can then include it on a report. When placed on a report, the metric becomes part of the report's definition and determines the data displayed each time the report is executed. For steps to add a metric to a report, see Reports: Adding metrics to a report.
To create a metric
- From the MicroStrategy home page, click New Metric
. If you are on a folder page, click Create on the icon bar on the left, then select New Metric.
- Select the function to use to calculate data in the metric. You can narrow the list of functions displayed in the pane by doing one of the following:
- To search for the function by name, type the function's name in the search field.
- Choose a function category from the drop-down list, such as Math Functions or Financial Functions. The pane is updated to include only the functions that belong to the selected category.
When you select a function, the function is added to the metric and a description of the function is displayed at the bottom of the dialog box. Click Details to view more information about the function, such as syntax and examples.
To define the metric's formula
Different options are available depending on the type of function selected above:
- If you selected a grouping function, such as Sum, Average, First, or Maximum, you define the metric's expression, as well as optional components such as level, condition, and transformation. Do one of the following:
- To specify the expression by typing the name of an object, type the name of the object in the Function field. As you type, matching objects are displayed in a drop-down list. You can type multiple objects, such as Revenue-Profit.
- To specify the expression by choosing an object, click the Browse icon
. The Select... dialog box opens. Navigate to and select an object, or search for the object.
- Depending on the function that you selected, you may be able to define parameters for the function. Click the Function Parameters icon
.
-
If you selected a non-grouping function, such as data mining, date, OLAP, and ranking functions, you are presented with options to define the input values (called arguments) for the function, as well as any parameters you can use to determine the behavior of the function. For guidance on arguments and parameters for the selected function, click Details at the bottom of the dialog box. Perform the following steps:
-
Depending on the function that you selected, you may need to determine arguments. For each argument listed, type a value or click the Browse icon
to find the metric, fact, prompt, or other compatible object to use as input values of the function.
An argument is the input value of a function. For example, you can select the Profit fact as the argument of the Average function, to calculate the average profit.
-
Depending on the function that you selected, you may need to define parameters. For each parameter listed, type a value or select the parameter value from the drop-down list.
Parameters determine the behavior of the function. For example, the NTile function requires two parameters, Ascending and Tiles. Ascending controls whether the NTiles are ordered in ascending or descending order, while Tiles determines the number of splits.
-
To select subtotal functions
You can determine which aggregation functions can be used to calculate subtotals for a metric. When the metric is added to a report and the report is run, users can display subtotals for the metric by selecting from the functions that you have made available. See Totals and subtotals for details on subtotals.
- Click the Options icon
.
- In the list of categories on the left, click Subtotals.
- Select the default function to use to calculate report subtotals from the Function for default subtotal drop-down list.
- You can select additional functions that will be available to calculate subtotals for the metric. To do this, click the expand icon
next to Select the subtotals you want available for this metric. Select the subtotal types to be available to the user when the report is run, and clear any subtotal types that you do not want to be available.
To select a dynamic aggregation function for OLAP Services
Dynamic aggregation allows you to change the level of report aggregation as users move objects off the report grid and into the Report Objects pane, and vice versa. You can define the dynamic aggregation function.
For an overview of OLAP services, see OLAP Services. For details to set up and use dynamic aggregation, see the Reports chapter of the Advanced Reporting Help.
- In the list of categories on the left, click General.
- Select the function to be used for the report aggregation from the Dynamic Aggregation function drop-down list.
- Click OK.
- Click Save.
The metric you created can now be added to a report. For steps, see Reports: Adding metrics to a report.
A metric definition can also include a level, condition, and transformation. To apply a level, condition, or transformation to your metric, see the sections listed below:
Joins for rank metrics
If you create a rank metric, which is a metric that ranks attribute elements by numbering them, for example, 1 through 10, you must set the metric's join type to outer. If the default inner join is used on a rank metric, some of the ranks (and therefore, the ranked attribute elements) may not appear on the report because an inner join does not include elements with null values in the result set. But an element with a null value may have a rank. With an outer join, all rows are displayed on the report even if there is no result displayed for some of the elements for some of the metrics on the report. For steps to set a metric's join type, see Determining how metric data is combined: Metric join types in Analyzing Data.