MicroStrategy ONE
Fact Expressions
Facts are objects created by and shared between MicroStrategy users. They relate numeric data values from the data warehouse to the MicroStrategy reporting environment. A fact expression defines how a fact is calculated. The fact expression is part of the Fact Definition component of a fact structure. You can use functions to create fact expressions, and arguments that are used in the expressions are columns.
Facts can be defined as:
- Implicit
- Derived
- Heterogeneous
For more information on facts and fact structure, see the MicroStrategy Project Design Guide.
In the context of MicroStrategy functions, this book discusses derived fact expressions.
Derived fact expressions can only use single-value functions, including simple arithmetic operators (+, -, /, *). See the following two examples.
Example 1: Subtraction ( - )
([UNIT_PRICE] - [UNIT_COST])
The fact Unit Profit is defined using the table columns Unit_Price and Unit_Cost and a simple mathematical operator, subtraction.
Example 2: Multiplication ( * )
([QTY_SOLD] * ([UNIT_PRICE] - DISCOUNT))
The fact Revenue is defined using three table columns and two arithmetic operators, subtraction and multiplication.
Both examples can be found in the MicroStrategy Tutorial project in the following folder: MicroStrategy Tutorial/Schema Objects/Facts.
To Access Fact Expressions
For a New Fact with an Expression
- In the MicroStrategy Developer File menu, point to New > Fact.
- The Expression page is where the expression is built. The functions are accessed in one of the following ways:
- Click (Insert Function) in the Definition pane. The Insert Function wizard opens.
- Type the function name and all required expression syntax directly in the Enter your formula here box.
For an Existing Fact
- Select an existing fact in the MicroStrategy Developer main screen. Then right-click and select Edit. The Fact Editor displays with the selected fact loaded.
- Click New to add a new expression to the fact, or select an existing expression and click Modify. The Create New Fact Expression or Modify Fact Expression page displays.
- Build an expression by using functions in one of the following ways:
- Click (Insert Function) in the Definition pane. The Insert Function wizard opens.
- Enter the function name and all required expression syntax directly in the Enter your formula here box.
You can use either the Fact Editor or the Fact Creation Wizard to create facts; however, only the Fact Editor allows you to use advanced expressions to define the fact.