Manage base formula objects
You can try these workflows with REST API Playground.
Learn more about MicroStrategy REST API Playground here.
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
dateCreated
,dateModified
,versionId
,primaryLocale
,objectId
,subType
, andname
.For a base formula,
subType
isagg_metric
. -
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ℹ️ Info
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.
If
showExpressionAs
is omitted, only "text" formats are returned.If
showExpressionAs
istree
, "text" and "tree" formats are returned.If
showExpressionAs
istokens
, "text" and "tokens" formats are returned.
For more information about the Modeling service, see Configuring the Modeling Service.