Strategy One
Create a Stand-Alone Metric
Beginning in Strategy One (June 2025), the Metric Editor in Workstation has been updated to improve usability, functionality, and performance. It now includes creating base formulas and adding levels, conditions, and transformations to all layers of nested metrics, functions available in MicroStrategy Developer.
You can create and add metrics to a Strategy project to perform calculations on your business data. Metrics represent business measures and key performance indicators. Use these metrics on reports, documents, and dashboards to analyze your data.
To create a metric, you define the metric's formula, which consists of the following:
- Function: The calculation applied to your business data, such as Sum or Count. Your metric may contain multiple functions.
- Expression: The business data from your data source. The expression can contain business facts, attributes, or other metrics.
You can create simple metrics such as summing the sales figures or more complex ones that use non-group functions such as running sum, custom expressions such as percent-to-total metrics, levels, filters, and transformations. You can also create nested metrics, which contain multiple layers of functions.
For more background information about metrics, see:
- Introduction to Metrics for a definition and an example
- Basic Reporting Help for an introduction to metrics and some basic examples
- Advanced Reporting Help for more detailed steps to create a metric, including examples of level, conditional, and transformation metrics
- Functions Reference for descriptions of functions, including syntax
Stand-Alone Vs. Derived Metrics
This topic discusses stand-alone metric objects. You can also create derived metrics within reports, dashboards, and documents. They are not saved as separate objects. See:
-
Metrics in Dashboards for an introduction to derived metrics created in dashboards
Create a Metric
- Open the Workstation window.
- From the File menu, select New Metric.
- To edit an existing metric instead, find the metric and double-click it.
- If you are connected to multiple environments or projects, select an environment and project. The Metric Editor dialog box opens.
-
Click the metric Name, type a new name, and press
Enter
. -
Choose a data type for the metric in the Data Type drop-down list, or leave it as Default.
-
Some data types allow you to format them. For example, if you choose Binary, you can set the Byte Length; if you select Decimal you can set the Precision and Scale. When formatting is available, the More Settings (three dots) icon
becomes available. Click it to set the formatting.
-
-
Type a Description for the metric.
You can type the metric formula in the Formula pane or use the Objects pane and the Functions pane for a more guided experience. Steps for each method are provided below.
Use the guided experience
-
Click the Functions pane
to search for and select a function.
-
To locate a function, type its name in the Search box.
-
You can also browse for a function by selecting a function category (such as Basic Functions or String Functions) from the drop-down list.
-
When you select a function, its description and syntax display at the bottom of the Functions pane.
-
Double-click a function to add it to the Formula pane. When you add a function, its syntax and description display in a pop-up, as shown below. You can copy and paste the parameter syntax (such as <Tiles, Ascending, BreakBy> in the image shown below) into the Formula pane and edit them. Use the example and the Details link displayed at the bottom of the Functions pane for assistance. Some parameters are also automatically filled in when you validate the formula.
-
-
Click Objects
and use the pane to search for and select the object to use in the expression. The object can be a base formula, which is re-usable metric definition.
-
To locate an object, type its name in the Search box.
-
You can also browse for an object by using the drop-down list and folders.
-
Double-click an object to add it to the Formula pane.
Type the metric formula
-
- Type the metric formula in the Formula pane on the left. The formula consists of arithmetic operators (+, -, *, and /) and functions such as Average, Rate, and MonthEndDate. The operators and functions are applied to attributes, facts, or metrics. As you type, matching objects, such as functions, attributes, facts,
metrics, and base formulas, display in a drop-down list. To add an object to the
metric, do one of the following:
- To add an object from the list, select the object's name.
- When you select a function, its syntax and description display in a pop-up. You can copy and paste the parameter syntax into the Formula pane and edit them. Use the example and the Details link displayed at the bottom of the Functions pane for assistance. Some parameters are also automatically filled in when you validate the formula.
- Click here for examples of metric formulas.
Simple metric:
Sum(Cost)
where Cost is a fact and Sum is a function that calculates the sum of the cost values.Compound metric (combining multiple metrics): Sum(Cost + Profit), where Cost and Profit are metrics and Sum is a function that calculates the sum. In this case, the sum of the Cost metric is added to the sum of the Profit metric.
Compound metrics also use non-group functions such as OLAP and scalar functions: RunningAvg(Cost), where Cost is a metric and RunningAvg is a scalar function that calculates the running average.
Metric using Apply functions (also known as database-specific or pass-through functions): ApplySimple ("Datediff (YY, #0,getdate ())", [BIRTH_DATE]) to calculate the age of employees based on today's date and their birth date.
-
Click Validate to check the formula and automatically fill in some parameters and the report level. In the example below, information about the level displays between curly braces {}. This indicates that the formula uses the report level with standard filtering and standard aggregation.
-
You can edit the parameters that have been added. For example, you added the NTile function and the Revenue metric then clicked Validate. The parameters for the number of tiles and whether the values are sorted in ascending or descending order are automatically added, as shown below. You can edit the number of tiles and change Ascending to be false.
-
If it is not a valid expression, check and repair the formula's syntax.
-
Click OK to save the formula and enable the other tabs such as Breakdown.
-
Click Save.
- You
can further define the metric by adding a level, condition,
and/or transformation. Click Breakdown then:
To define the attribute level to evaluate the metric at, add a level to the metric. A level metric can calculate regional revenue values, even if the report displays the City attribute. Use the regional metric in a contribution metric to calculate how much each city contributes to total regional revenue.
Click here for steps to add a level. You can add multiple levels to the metric.Click Level. If the metric is a nested metric that uses one function inside of another, you can apply separate levels to the different formulas. To add a level to the inner formula, expand the Base Formula and then the inner formula before clicking Level. For an example of a nested metrics and steps to create one, see Create a Nested Metric.
In the Level area, click Add New and choose Select an Object.
Search for or navigate to the attribute to use as the level's target, then click Select.
Select a Filtering option from the drop-down list. This determines how the report filter affects the metric calculation.
To include only data that meets the conditions in the report filter in the metric calculation, select Standard filtering.
To raise the level of the report filter to the level of the target, if possible, then apply the report filter to the metric calculation, select Absolute filtering.
To ignore any conditions in the report filter that are based on the target attribute, as well as any parent or child attributes of the target, select Ignore filtering.
To allow the target and group components of the level to define the filter, select None
Select an Aggregation option from the drop-down list. This determines whether the metric calculates at the target attribute level (Standard) or if it excludes it (None).
To remove any levels that you added and restore the report level if you removed it, click Reset.
A level allows you to specify the attributes to use in the metric calculation, regardless of what is contained on any report, document, or dashboard the metric is placed on. By default, a metric is calculated at the level of the attributes on the report, document, or dashboard, making it highly adaptable and reuseable. This is shown as the Report Level in the interface. You can remove the report level so that only the level explicitly set on the metric affects the metric calculation, regardless of what the report contains. For background information on level metrics, including details on the filtering, aggregation, and advanced options and effects of removing the report level, see Level Metrics: Changing the Level of Calculation for Metrics.
To filter the data included in the metric, add a condition to the metric. For example, a conditional metric calculates revenue for a specific region or time frame.
Click here for steps to add a condition. You can add multiple conditions to the metric.Click Condition. If the metric is a nested metric that uses one function inside of another, you can apply separate conditions to the different formulas. To add a condition to the inner formula, expand the Base Formula and then the inner formula before clicking Condition. For an example of a nested metrics and steps to create one, see Create a Nested Metric.
In the Condition area, click Add New.
Search for or navigate to the filter to apply to the metric, then click Select.
When a report contains a filter and a conditional metric, the report filter and the filter contained in the metric (the metric filter or metric condition) interact to produce the data for the conditional metric. The advanced options for the conditional metric establish this interaction.
Metric conditions (also called metric filters) are applied to the metric without affecting any other metrics on a report, document, or dashboard. For background information, including details on the advanced options, see Conditional Metrics: Applying Filters to Metrics. For information on report filters, which affect multiple metrics on a report, see Create Filters.
To apply offset values such as "four months ago" to a metric, you add a transformation.
Click here for steps to add a transformation. You can add multiple transformations to the metric.Click Transformation. If the metric is a nested metric that uses one function inside of another, you can apply separate transformations to the different formulas. To add a transformation to the inner formula, expand the Base Formula and then the inner formula before clicking Transformation. For an example of a nested metrics and steps to create one, see Create a Nested Metric.
In the Transformation area, click Add New.
Search for or navigate to the transformation to apply to the metric, then click Select.
For example, you can compare revenue numbers from this year to last year. While transformations are most often used for discovering and analyzing time-based trends in your data, not all transformations have to be time-based. For example, a transformation can map defunct product codes to new ones. For background information, see Transformation Metrics: Creating Time-Series Analysis.
-
You can format the metric's column headers and values. For steps, see Formatting Metrics.
-
You can set a variety of options, including selecting the functions that can be used to total the metric on a report, selecting the dynamic aggregation function, specifying joins, and setting VLDB properties such as null checking. For steps, see Applying Metric Options.
-
Click Save.
Continue creating the metric
Once you have created a metric, you can add the metric to a report, document, or dashboard to analyze your data. For steps, see Create and Edit Reports, Document Authoring, or Create a Blank Dashboard. You also use metrics when creating Create Filters and prompts (see Create and Edit Object Prompts for Reports and Create Value Prompts).
Related Topics
-
Introduction to Metrics for a brief overview of metrics
-
Applying Metric Options for steps to define dynamic aggregation and subtotal functions, VLDB properties, metric aliases, the metric join type, and other settings