Using Aggregate Bindings With Focus Clustering
You can use aggregate bindings in primary rules and sub-rules if you select focus clustering. Aggregate bindings perform computations across data records that are evaluated within a primary rule or sub- rule. Aggregate bindings calculate maximums, minimums, sums, averages, and counters. An attribute is defined for each calculated binding value, and the results of the aggregate binding calculations reflect values as they relate to the selected attributes.
The following expressions are used for performing calculations by applying aggregate bindings to a rule. The argument (arg) represents the selected attribute (predefined in the scenario) for defining your binding calculations:
- Max(arg): Finds the maximum attribute value for all records that meet the constraint.
- Min(arg): Finds the minimum attribute value for all records that meet the constraint.
- Sum(arg): Adds the attribute values for all records that meet the constraint.
- Avg(arg): Calculates averages of the attribute values for all rules that meet the constraint.
- CountDistinct(arg): Counts the number of unique entities found that meet the constraint.
- Count(): Counts the total number of entities found that meet the constraint.
- Count All(): Counts the total number of entities found regardless of the constraint.
Note:
You can use conditional expressions only for sum and average functions.Refer to section Adding Bindings to a Primary or Sub-Rule, for information about defining expressions for rules.
The following table provides sample values for the function of aggregate bindings.
Table 8-3 Sample Values of Aggregate Bindings
Trade | Amount of Trade (Attribute= AMT) | Trader (Attribute=TRADER) | $500Constraint Met(Y/N) |
---|---|---|---|
Trade 1 | 100 | Joe | N |
Trade 2 | 1,000 | Taylor | Y |
Trade 3 | 10,000 | Taylor | Y |
Results are:
Min(AMT): $ 1,000
Max(AMT): $ 10,000
Sum(AMT): $ 11,000
Avg(AMT): $ 5,500
CountDistinct(TRADER): 1
Count(): 2
CountAll(): 3