MicroStrategy ONE
Totals and subtotals
You can enable subtotals and grand totals for a metric, so that analysts can display them on a report at run time. You must decide what function will be used to calculate a subtotal or grand total for a given metric. You can enable several different subtotals from which analysts can choose, depending on their analysis needs.
To see an example of a report with subtotals and a grand total, in the Tutorial project open the Subtotals report, which is displayed below. The example below shows subtotals for each region, an additional subtotal for each quarter (encompassing all regions), and a grand total at the bottom of the report.
Grand totals (usually called totals) and subtotals allow users to control how metrics are further calculated at different levels (such as by quarter, by year, by region, and so on), and they can be applied dynamically by the analyst to any report on which a metric is used that has the totals or subtotals enabled.
When you enable a total or subtotal for a metric, you select a function by which the metric should be aggregated to display the total or subtotal. You can use one of many standard functions such as total, count, minimum, maximum, standard deviation, and others.
You can also create your own functions to be used with subtotal calculations. For details on creating your own function, see the Advanced Reporting Help.
For more advanced information on subtotals, see the Advanced Reporting Help.
Applying a grand total or subtotals to a metric
The following steps show you how to enable a grand total or 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. Steps are also provided below to remove totals and subtotals so that they cannot be displayed on a report.
To enable totals or subtotals for a metric
- In MicroStrategy Web, click the metric for which you want to enable a grand total or subtotals. The Metric Editor opens in either Function Editor mode or Formula Editor mode, depending on the type of metric you chose to edit.
- 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.
- Click OK.
- Click Save.
To remove a grand total or subtotals from a metric
You may want to remove, or disable, a grand total or subtotals for a particular metric. For example, if the metric counts inventory numbers, subtotals may be irrelevant and should therefore not be displayed on a report.
- In MicroStrategy Web, click the metric for which you want to enable a grand total or subtotals. The Metric Editor opens in either Function Editor mode or Formula Editor mode, depending on the type of metric that you chose to edit.
- Click the Options icon
.
- In the list of categories on the left, click Subtotals.
- To prevent a grand total from appearing when the metric is used on a report, from the Function for default subtotal drop-down list, select None.
- To prevent any subtotals from appearing when the metric is used on a report, click the expand icon
next to Select the subtotals you want available for this metric. Clear all subtotal types.
- Click OK.
- Click Save.
When this metric is used on a report in the future, the removed totals or subtotals cannot be displayed as part of the report.
Smart totals
Smart totals are also referred to as smart metrics. Smart totals are used on compound metrics.
Smart totals allow you to change the default evaluation order of a compound metric. For details on what a compound metric is, see Metrics made up of metrics: Compound metrics. Smart totals calculate subtotals on individual elements of the compound metric. For example, a smart metric uses the formula Sum (Metric1) / Sum (Metric2) rather than Sum (Metric1/Metric2).
The smart metric property is available for compound metrics and for some simple metrics which combine two or more calculation formulas with arithmetic operators. To enable or disable smart metrics, use the Allow Smart Metric check box on the Advanced Metric Options dialog box in the Metric Editor.
For example, consider the following report.
Year | Revenue | Discount | Ratio of Discount to Revenue |
2005 |
$200 |
$50 |
25% |
2006 |
$100 |
$50 |
50% |
If you choose to display the grand total for the report without using smart totals for the Ratio of Discount to Revenue metric, you get the following results.
Year | Revenue | Discount | Ratio of Discount to Revenue |
2005 |
200 |
50 |
25% |
2006 |
100 |
50 |
50% |
Total |
300 |
100 |
75% |
However, the Total value in the last column is incorrect; it is displaying a sum of the percentages of the Ratio of Discount to Revenue metric. To calculate a meaningful total value for this metric, enable smart totals by editing them in the Metric Editor and selecting the Allow Smart Metric option. When you select the Allow Smart Metric check box, you get the following correct results.
Year | Total Sales | Discount Sales | Ratio of Discount Sales to Total Sales |
2005 |
200 |
50 |
25% |
2006 |
100 |
50 |
50% |
Total |
300 |
100 |
33.33% |
A more complex business example for smart totals is provided in the Advanced Metrics chapter of the Advanced Reporting Help.
To enable or disable smart totals for a metric
- In MicroStrategy Web, click the metric for which you want to enable or disable smart totals. The Metric Editor opens in either Function Editor mode or Formula Editor mode, depending on the type of metric that you chose to edit.
- Click the Options icon
.
- From the left, click General.
-
Do one of the following:
- To enable smart metrics, select Allow smart metric.
- To disable smart metrics, clear Allow smart metric.
- Click OK.
- Click Save.