Subtotals allow you to dynamically control the computation and display of report data within desired groupings. Subtotals are applied to report metrics to calculate totals and for dynamic aggregation.
You can use REST API requests retrieve, create, and update the subtotal objects through the Modeling service:
- Retrieve a Subtotal's Definition
- Retrieve a Subtotal's Definition within a Changeset
- Create a Subtotal within a Changeset
- Update a Subtotal within a Changeset
There are three important fields in the API response body defined for a subtotal:
information: Stores the basic subtotal information include
For a subtotal,
expression: Stores the aggregation types and targets defined in the subtotal either using single-value functions or group-value functions.tip
Tokens are a semi-structured representation of a MicroStrategy expression text that includes object references. When the subtotal’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 subtotal's “expression" is presented in the following formats:
- "text": A human-readable, but non-parsable text, describing a subtotal's expression.
- "tree": A tree data structure fully defining the subtotal's expression.
- "tokens": A list of parsed tokens that define a subtotal's expression. Generating tokens requires additional time.
showExpressionAsis omitted, only "text" formats are returned.
tree, "text" and "tree" formats are returned.
tokens, "text" and "tokens" formats are returned.
dimty: Contains a list of
DimtyUnit, which describes the level at which the subtotal can be calculated.
For more information about the Modeling service, see Configuring the Modeling Service.