MicroStrategy ONE
Example: Creating compound attributes
You must create a compound attributes when an attribute requires two or more columns to uniquely identify its elements. In the MicroStrategy Tutorial project, Distribution Center is an example of a compound attribute. To uniquely identify a distribution center, one must know two details about the distribution center: the ID of the distribution center and the country in which it exists. This data is represented by the Dist_Ctr_ID
and Country_ID
columns respectively. The same Distribution Center identification numbers can exist for different distribution centers, but in the same country, each distribution center has a unique identification number.
Therefore, both the Country_ID
and Dist_Ctr_ID
columns must be grouped together for the Distribution Center attribute. This ensures that data about distribution centers is displayed correctly and completely on a report. To support this functionality, a form group must be created. A form group is a grouping of attribute forms to create a compound attribute.
Follow the procedure below to create the Distribution Center compound attribute.
You can also use Architect to create compound attributes, as described in Creating and modifying multiple attributes.
To create the Distribution Center compound attribute
-
In MicroStrategy Developer, log in to the project source that contains the MicroStrategy Tutorial project and then log into MicroStrategy Tutorial.
-
Navigate to the My Personal Objects folder, and open the My Objects folder.
-
From the File menu, select New, and then Attribute. The Attribute Editor opens, with the Create New Form Expression dialog box displayed on top of it.
-
From the Source table drop-down list, select the LU_DIST_CTR table. This is the table in which the two ID columns of Distribution Center reside.
-
Double-click the COUNTRY_ID column to add it to the Form expression pane on the right.
-
Select Automatic mapping and click OK. The Create New Attribute Form dialog box opens.
-
In the Form general information area, in the Name field, type Country ID.
-
Keep all other defaults, and click OK.
-
In the Attribute Editor, click New to create the other attribute ID form. This attribute form maps to the distribution center ID column necessary to complete the definition of the Distribution Center attribute.
-
Double-click the DIST_CTR_ID column to add it to the Form expression pane on the right.
-
Select Automatic mapping and click OK. The Create New Attribute Form dialog box opens.
-
In the Form general information area, in the Name field, type Distribution Center ID.
-
In the Form category section, from the Category used drop-down list, select ID. Click OK.
You must designate this attribute form as an ID column so that it can be combined with the Country_ID
form to create one unique identifier ID for the Distribution Center attribute.
Create a form group
-
A dialog box notifies you that another form (in this case,
COUNTRY_ID
) is already using the ID form category and that you must create a form group to combine the two ID columns. Click Yes. The Create New Attribute Form dialog box opens. -
In the Name field, type Distribution Center and click OK. The Attribute Editor opens, with the form group you created in the Attribute forms pane.
-
Because this is only an example, close the Distribution Center attribute without saving your changes.
If you create a compound attribute, you must update the schema to see your changes in the project. Close all editors. Then, from the Schema menu, select Update Schema.