You use relational attributes to add attribute columns to the dimension tables, and to add attribute values to those columns. After creating and populating the columns, you can use the contents of the columns to run SQL SELECT statements against the dimension tables. Because the dimension tables can be joined to the fact table, the SELECT statements can retrieve values from the fact table based on attribute values that you define, rather than just on the member name. For information about using SQL to access relational attributes, see Using Relational Attribute Views.
You can define relational attribute columns by specifying a special user-defined attribute for the top level member of the dimension. This user-defined attribute has the following format:
RELCOL columnname datatype size
The parameters are:
The following examples show how to add relational attribute columns to dimension tables:
RELCOL Color CHAR(10)The following is displayed for "Product" in the outline editor in the application manager:
Product (UDAs: RELCOL Color CHAR(10) )
RELCOL Size INTEGERThe following is displayed for "Region" in the outline editor in the application manager:
Region (UDAs: RELCOL Size INTEGER)
RELCOL 'Audit status' VARCHAR(25)The following is displayed for "Measures" in the outline editor in the application manager:
Measures (UDAs: RELCOL 'Audit status' VARCHAR(25))In this example, the column name is surrounded by single quotation marks because the name includes a blank space.
Relational columns cannot be removed from relational tables; after you add one, it remains part of the dimension table as long as the table exists.
You can remove a relational attribute column from a dimension view by deleting the appropriate RELCOL user defined attribute, which also deletes the index of the relational attribute column.
To add a value to a relational attribute column, create a user-defined attribute for the member that has the following format:
RELVAL columnname datavalue
The parameters are:
The following examples correspond to the examples in Adding Relational Attribute Columns to Dimension Tables:
RELVAL Color 'Blue'The following is displayed for "Kitchen Sink" in the outline editor in the application manager:
Kitchen Sink (UDAs: RELVAL Color 'Blue')
RELVAL Size 42The following is displayed for "California" in the outline editor in the application manager:
California (UDAs: RELVAL Size 42)
RELCOL 'Audit status' 'checked'Then the following is displayed for Sales in the outline editor in the application manager:
Sales (UDAs: RELCOL 'Audit status' 'checked' )
You can automate the process of creating user-defined attributes by building data load rules. This is useful if you want to assign values to many members in a dimension. When you use the data load rules editor, you can add text before (and after) a column of data values from the external data table. If you prepare a data table that contains all the relational attribute values, the data load rules editor can generate the 'RELVAL columnname' portion of the user-defined attribute. The data load rules editor then restructures the outline and adds the relational attributes to the dimension.
To remove relational attribute values from their corresponding dimension, delete the user-defined attribute that defined the value. This replaces the value with a null in the relational attribute column.