Version 2021

Manage Metric Objects

You can use REST API requests to retrieve, create, and update metric objects through the Modeling service:

Training metrics, extreme metric, reference line metrics, and relationship metrics are not allowed to be retrieved, created, or updated through the metric REST API.

The following table lists important fields in the API response body defined for a metric:

Field Description
information Stores the basic subtotal information including dateCreated, dateModified, versionId, primaryLocale, objectId, subType, and name. For a metric, subType is metric.
expression

Stores the aggregation types and targets defined in the metric either using single-value functions or group-value functions.

Tokens are a semi-structured representation of a MicroStrategy expression text that includes object references. When the metric’s expression is represented as tokens, the text is broken down into pieces, or tokens, with information about what these pieces represent in the metadata.

A metric's “expression" is presented in the following formats:

  • "text": A human-readable, but non-parsable text, describing a metric's expression.

  • "tree": A tree data structure fully defining the metric's expression.

  • "tokens": A list of parsed tokens that define a metric's expression. Generating tokens requires additional time.

If showExpressionAs is omitted, only "text" formats are returned.

If showExpressionAs is tree, "text" and "tree" formats are returned.

If showExpressionAs is tokens, "text" and "tokens" formats are returned.

dimty

Contains a list of DimtyUnit, which describes the level at which the metrics can be calculated.

conditionality Contains a filter that needs to apply to the metric.

metricSubtotals

Contains a vector that needs to apply to the metric.

aggregateFromBase Contains a vector of subtotals to apply to the metric.

formulaJoinType

Indicates the formula join type for the metric.

dataType

Indicates the data type for the metric.

smartTotal

Indicates the total calculation type.

format Contains the header format and value format.

subtotalFromBase

Indicates the subtotal type for the metric.

columnNameAlias Contains the name used in SQL generation.

metricFormatType

Indicates the format type for the metric.

thresholds

Contains a list of thresholds applied to the metric.

For more information about the Modeling service, see Configuring the Modeling Service.