Roles (SAP BW)
You can also create expressions that refer
to roles instead of query items. You must use the roleValue function
to refer to a particular role. For example, you want to query against
a specific role in a hierarchy but the query item playing that role
is different at each level of the hierarchy. A single query can span
the different query items at each level. You can also use the roleValue function
when you know the role but not the underlying query item.
You can assign multiple roles to one query item, but the same role cannot be assigned to different query items in the same level.
Default roles are pre-defined for all parent-child hierarchies and for all levels in level-based hierarchies. Most of these roles are not visible in the IBM® Cognos® studios.
The roles that are reserved by IBM Cognos Analytics start with an underscore. The name for a custom role cannot start with an underscore.
Default roles
The default roles include the following:
- _businessKey
Represents the key for the level. This role is also used to drill through from one data source to another because the business key should be consistent across your organization.
The _businessKey role can be assigned to only one attribute in a level.
- _dimensionUniqueName
Returns the name of the dimension as defined in the Framework Manager model.
- _hierarchyUniqueName
Returns the name of the hierarchy as defined in the Framework Manager model.
- _levelLabel
Returns the label that is assigned to the level.
- _levelNumber
Returns the number for the level.
- _levelUniqueName
Returns the name that is assigned to the level.
- _longName
Is assigned to the query item that represents the long name for a level.
- _memberCaption
Presents the caption for a member that will be shown in the IBM Cognos studios.
- _memberDescription
Returns the description for a member within a dimension.
- _memberUniqueName
Returns the IBM Cognos member unique name.
- _parentUniqueName
Defines the name that is assigned to the parent of the selected query item.
- _planningDefault
Specifies which query item to use when measures are selected. This role is applicable only for IBM Cognos Planning and SAP BW.
- _rollupType
Defines how a query item is aggregated.
- _shortName
Is assigned to the query item that represents the short name for a level.
If a query item uses a default role, you cannot change its role. This applies to SAP BW metadata only.
Custom roles
You can create custom roles. Each role that you create must have a unique name. The roles that are reserved by IBM Cognos start with an underscore. The name for a custom role cannot start with an underscore. You can translate the custom roles in the model.
User-defined properties in OLAP data sources are assigned roles with the same name as the query item.