MicroStrategy ONE
Creating a Nested Metric
You can create a nested metric by directly typing the definition in the Metric Editor, or by adding an outer formula to a level metric that already exists in your project.
Both the inner and outer functions for the nested metric must be aggregation functions, such as Sum, Average, Maximum, and so on.
To Type the Definition for a Nested Metric
- Choose File > New > Metric.
If the New Metric dialog box appears, click the Empty Metric icon. If you do not want this dialog box to be shown in the future, select Don't show this dialog in the future. Click OK. For a full description of object templates, including a list of the objects that can use object templates, see Re-Using Objects Via Shortcuts and Object Templates .
- Choose Empty Metric and click OK.
- In the Definition pane on the right, enter the formula for the metric.
Avg(Sum(Revenue) {~, Category}) {~, Region}
, whereRevenue
is a fact. - Click Validate. You should receive a Valid Expression message in the status area. If not, check the formula for errors.
- Click Save and Close.
To Use an Existing Level Metric
- Choose File > New > Metric.
If the New Metric dialog box is displayed, click the Empty Metric icon. If you do not want this dialog box to be shown in the future, select Don't show this dialog in the future. Click OK. For a full description of object templates, including a list of the objects that can use object templates, see Re-Using Objects Via Shortcuts and Object Templates .
- Choose Empty Metric and click OK.
- In the Object Browser pane, browse to the level metric that you want to use.
- Drag the metric into the Definition pane.
- Enter the outer aggregation function, using the level metric as the argument.
Avg([Category Revenue]) {~, Region}
, whereCategory Revenue
is a level metric, defined asSum(Revenue) {~, Category}
. - Click Validate. You should receive a Valid Expression message in the status area. If not, check the formula for errors.
- Click Save and Close.