About Aggregate Binding
"Aggregate binding" refers to a special kind of data binding that you can apply only to Edit and Static components. This type of binding allows you to display various kinds of aggregated information for a given property.
When a form that has aggregate binding applied to a component is run, the system calculates the value for the field based on the type of aggregate binding that is applied and the data that is returned to the form.
For example, if a field has aggregate binding of the type Summary (SUM) on a component, then the system adds together the value of all records that have a value for the property associated with the binding and displays the total in the Edit or Static component.
It is worth noting here that the aggregate calculation works only on the data that is actually returned to the form. This operation does not go to the database to calculate the aggregate value using all the possible matching data. This is important to note especially in cases where there is a record cap in place or when using Filter-In-Place.
If the user then gets more records (or otherwise adds or deletes records from the collection), the system automatically recalculates and redisplays the SUM, again based only on the data that has been returned. The same is true if other changes to dependent property values occur.
Mongoose supports these types of aggregate values:
- (SUM) adds together the value of all records that have values for the specified property and displays the total.
- (AVG) adds together the value of all records that have values for the specified property, and then calculates and displays the mean average.
- (MIN) finds the record that has the least/lowest value for the specified property and then displays that value.
- (MAX) finds the record that has the greatest/highest value for the specified property and then displays that value.
- (CNT) adds up the number of records that have a value for the specified property and then displays that number.