HOME COMMUNITY BLOG

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Attributes

RelationSpecifies a relation to an entity that contains the fields you want to summarize using an aggregation aggregate function.
AggregationTypeIndicates the aggregation aggregate function. Possible values are:
  • Count

  • Sum

  • Average

  • Minimum

  • Maximum

FieldSpecifies on which column from the entity specified in the Relation attribute the aggregation will occur.

How It Works

Aggregated fields behave differently depending on how you design your data structure.

Static Aggregation

If your data structure only contains the entity with the aggregated field but not the child-entity from which the aggregation is calculated, then the data will be selected on the database level using an SQL aggregate function.

Dynamic Aggregation

But you can also include the child entity in the target data structure.

E.g.

  • Invoice
    • InvoiceDetail

In that case the aggregation will be calculated in-memory and on each change in the detail entity the aggregation will recalculate. This way the user will see the recalculated total automatically after he changes the detail data.

Example

You want to create a total field InvoiceTotal in an entity Invoice. This field should give a summary of all Price fields in the InvoiceDetail entity.

To do this, you create an aggregated field in the Invoice entity. It will have the following attributes:

RelationInvoiceDetail
AggregationTypeSum
FieldPrice

This field will then display a total price on the invoice level automatically.