MicroStrategy ONE
Creating facts
With Architect you can create facts as part of your initial project design effort as well as throughout the entire life cycle of a project.
To save the time it takes to create all the facts required for your project, you can allow Architect to automatically create facts when tables are added to your project. When tables are added to the project using Architect, facts are created for columns in tables that use numeric data types and are not used for attribute forms. To enable this automatic fact creation, see Defining project creation and display options.
The procedure below describes how to create a fact using Architect.
Prerequisites
The procedure below assumes you have already created a project object and added tables to the project. For information on creating a project using Architect, see Creating projects using Architect.
To create a fact using Architect
-
In MicroStrategy Developer, log in to a project.
-
From the Schema menu, select Architect.
-
If a message is displayed asking if you want to open Architect in read only mode or edit mode, select Edit and click OK to open Architect in edit mode so that you can make changes to the project. MicroStrategy Architect opens.
If you are only given the option of opening Architect in read only mode, this means another user is modifying the project's schema. You cannot open Architect in edit mode until the other user is finished with their changes and the schema is unlocked.
For information on how you can use read only mode and edit mode for various schema editors, see Using read only or edit mode for schema editors.
-
From the Project Tables View, locate and select the table that includes a column or columns to use in a fact definition.
-
Right-click the table and select Create Fact. A dialog box opens to name the fact.
Rather than creating facts by manually creating a fact expression, you can allow Architect to automatically create simple facts defined on one column. To do this:
-
Right-click the table, point to Recognize, and then select Facts. The Results Preview dialog box opens.
-
If facts are displayed, these facts can be created as described below:
-
Facts can be created for columns in tables that use numeric data types and are not used for attribute forms, as described in Defining project creation and display options.
-
Facts can be created by automatically mapping columns to facts already defined in your project, as described in Defining project creation and display options.
Select the check box for a fact to create the fact.
-
-
Click OK. The facts you selected for creation are created within the table. If you use this option to create simple facts, you can then skip to To define fact expressions and column aliases.
-
-
Type a name for the fact, and click OK. The Create New Form Expression dialog box opens to create a fact expression.
-
From the Available columns pane, drag and drop a column into the Form expression pane.
You can include multiple columns as well as use numeric constants and mathematical operators and functions to create a fact expression. For information on creating various types of fact expressions, see Mapping physical columns to facts: Fact expressions.
-
In the Mapping area, select Automatic or Manual:
-
Automatic mapping means that all of the tables in the project with the columns used in the fact expression are selected as possible source tables for the fact. You can then remove any tables mapped automatically and select other tables.
-
Manual mapping means that all of the tables in the project with the columns used in the fact expression are located but are not selected as possible source tables for the fact. You can then select which of those tables are used as source tables for the fact. Other scenarios in which you should use the manual mapping method include:
-
If you are creating a constant expression that is not based on a physical column in a project table, you must select the tables to apply the constant expression to.
-
If the same column name does not contain the same data across different tables, manually select the appropriate source tables for each fact.
For example, suppose you have a column named
Sales
, which exists in both theFact_Sales
table and theFact_Discount
table. In theFact_Sales
table, theSales
column contains revenue data. However, in theFact_Discount
table, theSales
column contains discount data. In other words, although the column name is the same in both tables (Sales
), the columns contain different fact data in each table. When creating the Revenue fact, you must select the Manual mapping method so you can select theFact_Sales
table as a source table for the Revenue fact. When creating the Discount fact, you must select the Manual mapping method so you can select theFact_Discount
table as a source table for the Discount fact. If you use the Automatic mapping method in both cases, the MicroStrategy SQL Engine may use the incorrect column for the facts.
-
-
-
Click OK to close the Create New Form Expression dialog box and create the fact. The fact is displayed in the table used to create the fact.
To define fact expressions and column aliases
-
You can continue to define the fact by right-clicking the fact and selecting Edit. The Fact Editor opens. Use the tabs of the Fact Editor to define fact expressions and create column aliases as described below:
-
Definition: This tab allows you to define fact expressions. Fact definitions are discussed in How facts are defined .
-
Column Alias: This tab allows you to create a column alias for the fact. Column aliases are discussed in Fact column names and data types: Column aliases.
For detailed information about the options on each tab within the Fact Editor, refer to the MicroStrategy Developer Help (formerly MicroStrategy Desktop Help).
You cannot create fact level extensions using Architect. For information on how to create fact level extensions, see Modifying the levels at which facts are reported: Level extensions.
-
-
When your changes are complete, click OK to return to Architect.
-
From the Home tab, in the Save area, click Save and Update Schema to save your changes.