Aggregations

Overview

An Aggregation is a dynamic data provider that represents a database Column that is aggregated over a set of records, therefore it belongs to a Table.

Just like real database columns, calculations may be placed as fields on forms, used as data providers for different components, and requested programmatically.

Get Started

To work with Aggregations you need to open the Table where you will add them using the Table Editor.

Add an Aggregation

Add Aggregation
  1. In the Table Editor, select the Aggregations tab at the bottom after all the Columns

  2. Select the solution where you want to add the Aggregation and click the Add button

  3. Set the property with a valid name

  4. Select the Type of the Aggregation, the available options are

    1. Count, the number of records in an entire Foundset containing a non-null value for a column

    2. Count distinct, same as Count but count unique values

    3. Maximum, the largest value for a numeric column in an entire foundset

    4. Minimum, the smallest value for a numeric column in an entire Foundset

    5. Average, the average value for a numeric column in an entire Foundset

    6. Sum, the sum of all the values for a numeric column in an entire Foundset

  5. Select the Column that will be aggregated

  6. Save the editor

An aggregation is declared at the Solution level and is available throughout the solution in which it is declared. If it's declared in a Module, it will be available in all solutions that include the module

Edit an Aggregation

Similar to adding an Aggregation, open the Aggregations tab in the Table Editor, select the one you need to edit, and change any of the three properties: Name, Type, or Column then Save the editor

Delete an Aggregation

Similar to editing an Aggregation, open the Table Editor, select the one you need to delete, and click on the button "Remove" at the bottom of the list (you will be prompted to confirm)

Remarks

The scope of an Aggregation is the entire Foundset using a SQL query which means that the result will consider only the records represented by the WHERE clause of the Foundset.

For example, an Aggregation could be applied to a related Foundset, products_to_order_details.sum_quantity, to return the total number of product units ordered.

Last updated

Was this helpful?