Base formulas are mathematical expressions created using existing facts. They can be re-used to build any number of metrics.
You can use REST API requests to retrieve, create, and update the base formula objects through the Modeling service:
- Retrieve a base formula's definition
- Retrieve a base formula's definition within a changeset
- Create a base formula's definition within a changeset
- Update a base formula's definition within a changeset
There are two important fields in the API response body defined for a base formula:
information: Stores the basic information of a base formula's information including
For a base formula,
expression: Stored as simple base formulas without any dimensionality, conditionality, or subtotals. They can be reused to create any number of simple or complex metrics.tip
Tokens are a semi-structured representation of a MicroStrategy expression text that includes object references. When the base formula’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 base formula's “expression" is presented in the following formats:
- "text": A human-readable, but non-parsable text, describing a base formula's expression.
- "tree": A tree data structure fully defining the base formula's expression.
- "tokens": A list of parsed tokens that define a base formula'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.
For more information about the Modeling service, see Configuring the Modeling Service.