Set Key Columns to Uniquely Identify Records
Set one or more columns as keys to uniquely identify records in an entity. Key columns cannot contain null values and each value (or set of combined values for multi-column compound keys) must be unique.
Set Columns as Keys
To set a column as a key, select the checkbox in its Key column. You can set one column as a key or, if necessary, set multiple columns to define a compound key (see Compound Keys and Representative Keys).
Key columns cannot contain null values and each value (or set of combined values for multi-column compound keys) must be unique. To validate the data in your key columns, see "Key Validation Rules" in Validating View Data.
Keys and Associations
|
Semantic Usage |
Keys Required |
Mapping Keys When Creating Associations |
|---|---|---|
|
Fact |
You may set one or more key attributes for a Fact, but none are required. |
A Fact can point to a:
|
|
Dimension |
You must set one or more key attributes for a Dimension:
|
A Dimension can point to a:
|
|
Fiscal Time Dimension |
You must set exactly two key attributes for a Fiscal Time Dimension:
|
A Fiscal Time Dimension can point to a:
|
|
Text Entity |
You must set two or more key attributes for a Text Entity:
|
A Text Entity must not point to other entities. |
|
Hierarchy |
You must set one or more key attributes for a Hierarchy:
|
A Hierarchy will generally not point to other entities. |
|
Hierarchy with Directory |
You must set exactly two key attributes for a Hierarchy with Directory:
|
A Hierarchy with Directory must point to:
|
|
Relational Dataset |
You may set one or more key attributes for a Relational Dataset, but none are required. |
A Relational Dataset can point to any other entity and should generally follow the rules for dimensions. |
Compound Keys and Representative Keys
If you set more than one key column to uniquely identify records in a dimension, you should, in addition, specify a representative key, which is the column containing the most granular level of data. Specifying a representative key allows analytic tools to correctly consume the dimension.
|
Controlling Area |
Cost Center |
Name |
|---|---|---|
|
1 |
1000 |
Development |
|
1 |
1001 |
Support |
|
1 |
1002 |
Sales |
|
1 |
1003 |
Training |
|
2 |
2000 |
Development |
-
Open your table or view and set its Semantic Usage to Dimension.
-
Set two or more columns as keys.
-
In the Attributes section toolbar, click to open the Compound Key dialog.
-
Select a key in the Key Columns section and click Add to identify it as the representative key and move it to the Representative Key section.
-
[optional] Reorder keys in the Key Column(s) section by clicking and .
The Compound Key field shows the order of the key columns, with the representative key shown last and in bold.
-
Click Close to complete the definition of the compound key.