For the complete documentation index, see llms.txt. This page is also available as Markdown.

Aggregate data

The Aggregate data action node is used to perform aggregations on data in Data connectors. It is available in both Apps and Services.

Usage

This action node can be used when large amounts of data in the database should be aggregated (counted, summarized, averaged etc.) on database-level, i.e. without reading all the records to the Apps or Services client. You may filter and group the records being aggregated.

Aggregate data is suitable, for example, for Dashboards or Search pages where you want to display counts or summaries that span huge sets of data records.

Good to know

If your Solution requires complex data analysis and heavy aggregation workflows, you might benefit from Data Aggregation Service. This add-on provides access to specialized database infrastructure that caters exclusively to analytics and aggregation workloads. Read more in our Product Glossary.

Nested properties

By default, you can group by and aggregate on properties that belong directly to the object class behind the selected Data Connector. The Data Aggregation Service add-on additionally lets you group by and aggregate on nested properties: properties on related object classes, reached by following a reference.

For example, with a data connector of Orders you can group by the Region of each Order's related Customer, written as Order.Customer.Region. References can be followed through multiple levels, so you can also aggregate on a property several references away, such as Customer.Account.Tier.Price.

Nested properties are selected the same way as anywhere else you bind data. In the Property selector of a Group By item or an aggregation, select a reference property to open the related object class, then choose the property to use. Repeat to follow references through several object classes.

Good to know

Grouping by and aggregating on nested properties is available only when the Data Aggregation Service add-on is enabled for your Solution. When it is not enabled, the Property selectors list only the properties of the data connector's own object class.

Examples

In this example, no groupings or filters are applied. The chosen operator is Count, and the value should be written to the Count property of the Target Data Source. Note that the Count operator does not require a property to aggregate by. The result is one object in the data source Order aggregates (temp) with Count equal to the total number of Orders.

Properties

Property
Description

Data Connector

Select a data source of type data connector to perform aggregations on.

Selection

Define the objects to aggregate.

  • All objects

  • Filtered selection

Filter

Available when Filtered Selection is selected.

Define the filter to apply to the data connector.

Conditional Filters

Add filters that can be enabled or disabled runtime. All enabled filters will be applied in addition to the regular filter.

Sorting

Add sorting rules. The objects will be sorted before the grouping and aggregations are performed.

Target Data Source

Specify a runtime-only data source or service variable to place the resulting data in.

Operation

Select how existing objects in the Target Data Source will be treated. If the Target Data Source is a service variable the operation will be limited to Update single cardinality object.

  • Replace All Objects: Remove any existing objects before creating the objects.

  • Update single cardinality object: Update the selected property in the existing object.

  • Add to Data Source (merge duplicates): Keep any existing objects.

Group By

Only available if the Target Data Source is many-cardinality.

Optionally select one or more properties to group the data by and which property to write the group value to. This will create one aggregation per unique value of the selected property, and thus create multiple objects in the Target Data Source. Each grouping item has these properties:

  • Enabled: databind to a boolean value or set up a condition or function to enable or disable runtime. Default is true

  • Property: select which property to group the data by

  • Resolution: only available if the selected property is of type Datetime. Select which time resolution to group by, e.g., day, month or year.

  • Value: choose which property in the Target Data Source to write the grouping value to.

Aggregations

Add aggregations.

Each aggregation has these properties:

  • Enabled: databind to a boolean value or set up a condition or function to enable or disable runtime. Default is true

  • Operator: select which operator to apply in the aggregation, see the list of available operators below

  • Property: select which property to perform the aggregation on

  • Value: select which property in the Target Data Source to write the the aggregated value to

Aggregation Operators

Name
Description

Count

Returns the number of objects. It does not require the selection of a property.

Sum

Returns the sum of the values of the selected property.

Average

Returns the average value of the values of the selected property.

Max

Returns the maximum value of the selected property.

Min

Returns the minimum value of the selected property.

Population Standard Deviation

Calculates the population standard deviation of the values of the selected property. Use if the values encompass the entire population of data to be represented. Read more at https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/

Sample Standard Deviation

Calculates the sample standard deviation of the values of the selected property. Use if the values encompass a sample of a population of data from which to generalize about the population. Read more at https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/

First

Returns the first value of the selected property.

Last

Returns the last value of the selected property.

Last updated

Was this helpful?