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

1 In MicroStrategy Developer, log in to a project.
2 From the Schema menu, select Architect.
3 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.
4 From the Project Tables View, locate and select the table that includes a column or columns to use in a fact definition.
5 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:

a Right-click the table, point to Recognize, and then select Facts. The Results Preview dialog box opens.
b 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.

c 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.
6 Type a name for the fact, and click OK. The Create New Form Expression dialog box opens to create a fact expression.
7 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.

8 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 the Fact_Sales table and the Fact_Discount table. In the Fact_Sales table, the Sales column contains revenue data. However, in the Fact_Discount table, the Sales 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 the Fact_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 the Fact_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.

9 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

10 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.
11 When your changes are complete, click OK to return to Architect.
12 From the Home tab, in the Save area, click Save and Update Schema to save your changes.