28 May 2014

Substitution -- System Center Cube

Because relationship facts in the data warehouse may target abstract relationships and dimensions, you need to substitute in concrete dimensions so that the measure group will contain only instances that you want to browse.

This is illustrated in the following example.

<Substitution MeasureGroupName="IncidentAssignedTouser" RelationshipEndpoint="Source" Relationship="Workitem!System.WorkItemAssignedToUser" TargetDimension="DWBase!WorkItemDim" ReplacementDimension="IncidentDW!IncidentDim"/>
In this example, the IncidentAssignedToUser measure group points at the WorkitemAssignedToUser relationship. This relationship, however, will not only contain incidents, but it will also contain change requests and problems that have also been assigned to any users. To ensure that this measure group only contains incidents, Service Manager substitutes WorkItemDim with IncidentDim.
This means that the table that is created in the data source view for the measure group automatically performs an inner join on WorkItemDim with IncidentDim and returns only those instances where a join is valid based on the  EntityDimKey or BaseManagedEntityId.
Remember that you must define the relationship endpoint where you want to perform the substitution. This element is required because it is possible that the source and endpoint dimensions are identical and a methodology is needed to uniquely identify which dimension to substitute. An example of such a relationship is WorkItemRelates to WorkItem.

The substitution element is also used to define alias dimensions for the cube. In other words, you can define an alias name for a dimension, but it is not required to actually substitute a dimension. In effect, the substitution in this case is not on the dimension but on the cube dimension or alias dimension name, as shown in the following example:

<Substitution MeasureGroupName="IncidentAssignedToUser" RelationshipEndpoint="Target" Relationship="Workitem!System.WorkItemAssignedToUser" AliasTargetDimensionAs="AssignedToUserDim" TargetDimension="DWBase!UserDim"/>
In this example, the alias cube dimension name is AssignedToUserDim. This is the name of the dimension that will be used to actually filter on this cube. By allowing users to define alias names, names can be specifically tailored to enable the desired, many-to-many relationships in the cube. This makes more advanced filtering and analytical capabilities possible.

Finally, substitutions are valid not only for relationship facts but for custom facts as well. In this scenario, the relationship endpoint would be set to None. The following table describes substitution attributes.

Attribute
Required
Values
Definition
MeasureGroupName
Yes
String
The measure group name on which to perform the substitution
RelationshipEndPoint
Yes
(Target, Source, None)
The endpoint of the relationship to perform the substitution. By default, the value is None for custom facts.
Relationship
No
ManagementPackRelationship
The relationship to use for the substitution.
AliasTargetDimensionAs
No
String
The alias name of the original targeted dimension
AliasReplacementDimensionsAs
No
String
The alias name for the substituted dimension
DimensionAlias
No
ManagementPackDimension
The dimension alias from a custom fact if one exists


No comments:

Post a Comment