MicroStrategy ONE
Creating attributes
With Architect you can create attributes as part of your initial project design effort as well as throughout the entire life cycle of a project.
To save the time that it takes to create all the attributes required for your project, you can allow Architect to automatically create attributes when tables are added to your project. When tables are added to the project using Architect, attributes are created based on the automatic column recognition rules that you define in Architect. To enable and define this automatic attribute creation, see Defining project creation and display options.
The procedure below describes how to create an attribute 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 an attribute 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 a table that includes a column or columns to use in an attribute definition.
-
Right-click the table and select Create Attribute. The Create New Form Expression dialog box appears.
Rather than creating attributes by manually creating an attribute expression, you can allow Architect to automatically create simple attributes defined on one column. To do this:
-
Right-click the table, point to Recognize, and then select Attributes. The Results Preview dialog box opens.
-
If attribute forms are displayed, these attribute forms can be created as described below:
-
Attribute forms can be created based on these automatic column recognition rules that you define, as described in Defining project creation and display options.
-
Attribute forms can be created by automatically mapping columns to attribute forms already defined in your project, as described in Defining project creation and display options.
Select the check box for an attribute form to create the attribute form. If more than one attribute form is available for creation for an attribute, you must select the ID form. Any other attribute forms for that attribute are optional. For example, to create an attribute description form you must select the description form along with the ID form for the attribute.
-
-
Click OK. The attribute forms you selected for creation are created within the table. If you use this option to create simple attributes, you can then skip to To define attribute lookup tables, form expressions, and column aliases .
-
-
Create a form expression for the ID form of the new attribute being created, as described below:
-
To create a simple attribute form expression (Attribute form expressions), drag a column from the Available columns pane to the Form expression pane.
-
To create a more advanced attribute form expression, use a combination of any of the following techniques:
-
Enter constants in double quotes.
-
To create a function using the Insert Function Wizard, click f(x) in the Form expression toolbar.
-
To insert an operator into the expression, click any operator in the Form expression toolbar.
-
-
-
Click Validate to ensure that your expression is valid.
-
Under Mapping method, select Automatic or Manual:
-
Automatic mapping means that all of the tables in the project with the columns used in the attribute form expression are selected as possible source tables for the attribute form. You can then clear any tables mapped automatically or select other tables.
-
Manual mapping means that all of the tables in the project with the columns used in the attribute form expression are located but are not selected as possible source tables for the attribute form. You can then select which of those tables are used as source tables for the attribute form.
-
The mapping method defaults to Automatic for the first attribute or attribute form expression you create. The system maps the expression to each of the source tables. For subsequent attributes, the default is Manual.
-
An expression that uses only a constant value cannot use the automatic mapping method.
To use an attribute for meaningful analysis, you must verify that it includes a column from a fact table in its definition, or is related to an attribute that does. For example, to use the Month attribute for analysis, you must create a relationship to the Day attribute, which must include the DAY column from the fact table in its definition. To create relationships between attributes, see Defining attribute relationships.
-
-
-
Click OK to close the Create New Form Expression dialog box and create the attribute. The attribute is given a default name and is displayed in the table.
To change the default name of the attribute, right-click the attribute in the table and select Rename. Type the new name in the dialog box that appears and click OK to save and return to Architect.
To define attribute lookup tables, form expressions, and column aliases
-
You can continue to define the attribute by right-clicking the ID form for the attribute and selecting Edit. The Modify Attribute Form dialog box opens.
-
From the Source tables pane, select a table and click Set as Lookup to set it as the lookup table for the attribute. A lookup table acts as the main table which holds the information for an attribute. If you chose manual mapping, select the check boxes of the tables to map to the attribute form.
-
You can use the tabs of the Modify Attribute Form dialog box to define attribute form expressions and create column aliases as described below:
-
Definition: This tab allows you to define attribute form expressions. Attribute forms are discussed in Column data descriptions and identifiers: Attribute forms.
-
Column Alias: This tab allows you to create a column alias for the fact. Column aliases are discussed in Modifying attribute data types: Column aliases
For detailed information about the options on each tab within the Modify Attribute Form dialog box, refer to the MicroStrategy Developer Help (formerly MicroStrategy Desktop Help).
-
-
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.