MicroStrategy ONE
Required metric components
All metrics require the following components as part of the metric's definition:
- Mathematical formula, which includes a mathematical function
- Business level at which to calculate the formula
Both required metric components are described below.
Mathematical formula
A metric definition must contain a formula, which determines the data to be used from your data source and the calculations to be performed on that data. An example of the formula of a metric is
Sum(Cost)
where Cost is a fact stored in the data source. (Facts are one type of business data, typically numeric, stored in a data source.) The metric formula above calculates the sum of all costs recorded in the data source, to determine a measure of a company's expenditures.
A metric formula can be made up of facts in the data source (as in the example above), business attributes in the data source, or other metrics that have already been created. The following examples of metrics show these different formula options:
-
Metric made up of facts:
(Sum(Profit) + Sum(Cost))This metric's formula adds all profits recorded in the data source, adds all costs recorded in the data source, and then adds the cost total to the profit total.
-
Metric made up of attributes:
Count(Employee)This metric's formula counts the total number of company employees recorded in the data source. (An attribute is a business concept that is reflected in your stored business data, such as Year or Customer or Product. Attributes provide a context in which to evaluate metric data.)
-
Metric made up of other metrics:
[This month's profit] - [Last month's profit] / [Last month's profit]This metric's formula subtracts last month's profit (a metric) from this month's profit (another metric), then divides the result by last month's profit to determine the percent difference in profit from last month. Existing metrics can be part of a newly created metric's formula, and thus they become part of the new metric's definition.
A metric that contains other metrics is called a compound metric. Compound metrics are discussed in Metrics made up of metrics: Compound metrics.
If you are familiar with SQL syntax, a metric's formula is included in the SELECT clause of a SQL statement.
A metric formula that is shared among many metrics is called a base formula; for details, see Required metric components.
Function
Most metrics must also have a mathematical function as part of the metric formula. The function is part of the formula.
In the examples above, the functions are Sum and Count. If a formula did not have a function, a metric formula might consist solely of the Cost fact or the Profit fact, and the data results of such a formula would simply be the extensive list of all the costs or profits ever recorded in the tables in your data source.
The default function for every formula made up of facts is Sum. The default function for every formula made up of attributes is Count.
Once your formula is in the Function Editor, you can change the function, of course. MicroStrategy provides over a hundred functions that can be a part of all calculations, whether simple or complex. For a description and examples of every function available, see the Functions Reference . You can also create your own functions. See the Advanced Reporting Help for information on creating your own functions.
