Understanding Model and Rule Set Context
If you are creating a large number of rules, you can use Model and Rule Set Contexts to define default member selections for dimensions that will use the same member for all the rules in the model or rule set. This saves you from having to select the same members for a dimension each time the dimension is used in a rule.
Let's consider an example using the BksML50 sample application that is provided with Enterprise Profitability and Cost Management. In addition to the Entity and Account dimensions required in Enterprise Profitability and Cost Management, the sample application includes Customer, Activity, Driver, and Product custom dimensions. So, for each rule that you create in the sample application, you must select members for Entity, Account, Customer, Activity, Driver, and Product. See Dimension and Member Requirements When Creating Rules.
For this example, we will set up a model and rule set as follows:
-
Model: 10 Actuals Allocation Process
-
Rule Set: Occupancy Expense Allocations
Begin by setting up the 10 Actuals Allocation Process model. In this example, we can set up the Model Context to select default members for any of the Entity, Account, Customer, Activity, Driver, and Product dimensions.
As you consider the types of calculations you will be doing, think about whether it makes sense to narrow down the calculations to specific members for any of these dimensions.
In this example, allocations or custom calculations will affect all of the activities, customers, products, entities, and several accounts at some point. That leaves the Driver dimension. Assume that Driver has only one member, and there is only one rule that uses that member. Since Driver will only be used in one rule, you will save yourself time in the modeling process by creating a Model Context that defines the default selection for the Driver dimension.
Since we are not assigning an actual database member to the the Driver dimension, we will select NoDriver for the default member selection. NoDriver is a member that fufills the requirement that every dimension must have a member even if the dimension is not used in the rule. (The NoDriver member was set up and added to the Driver custom dimension when the Driver dimension was created.)
At this point, our context selections are:
The next step is to create the Occupancy Expense Allocations rule set. In this rule set, we want to use the Model Context we defined when we created the 10 Actuals Allocation Process model, where we set the Driver dimension to NoDriver. To do this, we will select Use Model Context in the Definition tab on the Create Rule Set page.
In addition to using the Model Context, we can create a Rule Set Context to define default members for any of the Entity, Account, Customer, Activity, and Product dimensions. (Note that the Driver dimension is not available to select in the Rule Set Context. This is because we enabled the Model Context, which has NoDriver defined for the Driver dimension. Any dimensions defined in the Model Context are not available to select in the Rule Set Context.)
Since we are creating rules for the Occupancy Expense Allocations rule set, we will not be moving data in the Activity, Product, or Customer dimensions, but we will be moving data in the Entity and Account dimensions. Since the Activity, Product, and Customer dimensions do not apply to the rules we will create in the rule set, we will set the Rule Set Context to No Activity, No Customer, and No Product for these dimensions.
As we did with the NoDriver selection we defined in the Model Context, we are assigning these "No<dimname>" members to fulfill the requirement that every dimension must have a member even if the dimension does not apply in the rule. Making these selections in the Rule Set Context means that you will not have to select members for these dimensions in any new rules that you create in the rule set.
At this point, our context selections are:
We are now ready to create the rules in the Occupancy Expense Allocations rule set. For each rule that we create in this rule set, we will select Use Rule Set Context.
Remember that the Rule Set Context in this example includes the Activity, Customer, and Product dimensions. In addition, the Rule Set also uses the Model Context, which set a default value for the Driver dimension. So, when we get to the definiton screen at the rule level, we will only see options to select members for Entity and Account.
At this point, our context selections are:
If you are creating a rule where either the Model Context or Rule Set Context does not apply, you can disable these selections. At the Rule level, you handle exceptions by deselecting Use Rule Set Context. At the Rule Set level, you handle exceptions by deselecting Use Model Context. Note that since the Rule Set Context also includes the Model Context, if you deselect Use Rule Set Context, you are also deselecting Use Model Context.
In our example, deselecting Use Rule Set Context results in all the dimensions in the application being displayed in the Source/Destination tab for allocation rules and in the Target tab for custom rules. Specifically, in addition to the Entity and Account dimensions, now the Activity, Customer, and Product dimensions from the Rule Set Context are displayed, and the Driver dimension from the Model Context is displayed.
Now let's consider what would happen if you set up rules in the BksML50 sample application and didn't define a Model Context and a Rule Set Context. Each rule still needs all six dimensions defined for the source and destination in allocation rules or for the target in custom rules. If you didn't define a model and rule set context, you would need to manually select members for all the dimensions for every rule you create. If your rule set contains 200 rules and all of them use same dimensions, it is more efficient to define the members for your dimensions in the Rule Set Context than to select then when you define each rule.