The Constraint option is used for semi-additive values so that business users will be prompted if they try to create a report with incompatible values. Use constraints to define how the aggregation is to be applied if the field is semi-additive.
An example of where this function is useful is shown below:
Month | Name | Head Count | |
---|---|---|---|
June | Fred | 1 | |
June | Jane | 1 | |
June | Mary | 1 | |
July | Fred | 1 | |
July | Jane | 1 | |
|
| 5 | Sum |
Given the above data, to sum the Head Count alone would result in 5 if Month were not included in the report. This would be misleading for a user (since 5 people were never employed at one time). If you put a constraint rule on Month that it is a mandatory field when Head Count is being summed, then this would result in the following data:
Month | Head Count | |
---|---|---|
June | 3 | |
July | 2 | |
| 5 | Sum |
As you can see from these results the report is more meaningful and correct. By applying a constraint to the aggregation of headcount the correct usage of the attribute is ensured by the end user in their reports. To access the rules applied to fields the semi-additive option must be selected from the format tab; once it has been selected the “Constraint” tab will appear, this is where the user defines the rules.
The rules that can be applied to a field are: exclude, mandatory, and one of list. The default rule is no constraint; this will result in no constraint being applied to the field.
Exclude | Being selected as the rule will result in the field not being allowed to be used in the report when the chosen aggregation is applied. |
Mandatory | Being chosen as the rule will indicate the field must be used in the report when the relevant aggregation is applied. |
One of list | Constraint will result in at least one of these fields being present in the report when being aggregated by the relevant field. |