Using Linked Models
By Kevin Hsu - Updated May 28, 2015
Linked models are used in various ways when designing and building an application. In this article we will discuss three main uses for Linked Models: Model Measures, Valid Form Relationships and Validation Models. To create a linked model, navigate to the Linked Model section of the Model you have selected. For more information, refer to the Kepion Modeler Guide.
Link models to make use of measures of another model
When there is a need to use measure values from another model, linked models is useful in providing access to those values. In this example: CPG-Financial Adjustment-Rules: Calculate Percentage uses [Profit_Value].
Use Linked Models for Valid Form Relationships
A more common purpose to link model is to define relationships in forms. These relationships define the valid combination of members across dimensions within a model. For instance, there might be a set of products that are sold in certain countries, or a relationship that defines which Accounts are valid for a set of Departments. You can configure relationship on a form by using the measure from a linked model of the parent model.
Let’s use the HR Planning model in WorkForce sample application as an example.
In the ‘By Metric’ form, we want to define a relationship between Department filter (i.e. Department dimension) and Employee Type filter (i.e. Employee Type dimension) so that whenever a department is selected, the employee type filter will only show the options that the department has.
For example, there is no Contract employee in AMERICAS, so when Department Filter is set to ‘AMERICAS’, ‘Contract’ will be hid from the candidate list, as shown below.
The Department – Employee Type relationship validation information is stored in [Dep-Emp-Type Validation] model (when there is a record existing in this model, the combination is considered ‘Valid’; otherwise it is ‘Invalid’). So we need to link it to [HR Planning] Model.
Select the LINKED MODEL tab of [HR Planning] Model. Click Add button in the ribbon. Check the in [Dep-Emp-Type Validation] and click OK.
Then go to the form. Click Edit and go to the RELATIONSHIP tab under ADVANCED tab. Click Add. Check the in [Dep-Emp-Type Validation] and click OK.
A relationship can be applied to Row, Column, and/or specified Filters. By default, it is not applicable to anything. We need to configure it based on our needs.
In this example, the Department filter should always have all departments listed as candidate options. The Employee Type filter should be controlled by the Department filter. This means we need to apply this relationship to Employee Type filter. To configure this, click the gear button, check the Employee Type box and click OK.
Please consider what if we apply this relationship to both Department and Employee Type.
(Answer: if so, when Contract is selected as the value for Employee Type, the candidate list for Department will not contain ‘AMERICAS’.)
Use Linked Models for Validation Models
Another use of linked models is in creating models to store validation information. [Dep-Emp-Type] Validation and [Emp Type-Metric] Validation in Workfoce sample application, and Combo Product-Entity in Revenue – Consumer Package Goods sample application are all models we created for dimension relationship validation purpose. Usually, these models tend to be simple. They contain the dimensions needed to define the relationship. For example, [Emp Type-Metric] Validation contains Employee Type and Metric dimension only.
We’ll use the [Emp Type-Metric] Validation as an example to illustrate here.
Here we have created a form to get all valid combinations.
A record in the model means the combination is valid, otherwise it is invalid.
[Emp Type-Metric] is a linked model to [HR Planning]. We can use it to define relationship in forms in [HR Planning] model. We can see relationship names contain two parts split by ‘_’. The first part is the name of the linked model. The second part is the measure. In this example, [Emp Type-Metric Validation] model has two measures: Value and Validation.
Sometimes there is more than one relationship existing among same dimension group. In this case, instead of creating multiple models with exact same model dimensions to define these relationships, we create additional measures to store different validation information. To see details, refer to the [Emp Type-Metric] model and [HR Planning] model to see how they are defined and used.
Training & Tutorials
Check out the Training & Tutorials section for walk-through videos.