a!aggregationFields() Function

Function

a!aggregationFields( groupings, measures )

Used to define a query against record data that performs an aggregation in a!queryRecordType(). Uses a!grouping() and a!measure() to define aggregate fields.

See also: a!queryRecordType, Measure Component, Grouping Component

Parameters

Keyword Type Description

groupings

Any Type

Fields to group by using a list of a!grouping().

measures

Any Type

Calculations to perform using a list of a!measure().

Returns

Aggregation Fields

Usage considerations

Supported use case

  • This configuration should always be used within the fields parameter of a!queryRecordType() to define the fields returned when aggregating data.

Using the grouping and measure parameters

  • a!grouping() and a!measure() must be used to define the groupings and calculations.
  • At least one grouping must be provided; adding measures is optional.
  • For each grouping or measure provided, the alias is required.

Example

This expression uses the record type Cases for the purpose of illustration only. If you copy and paste the expression below into an expression, it will not evaluate in your interface. Use it as a reference only.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
a!queryRecordType(
  recordType: recordType!Case,
  fields: a!aggregationFields(
    groupings: a!grouping(
      field: recordType!Case.fields.dateSubmitted,
      interval: "MONTH",
      alias: "month_submitted"
    ),
    measures: a!measure(
      field: recordType!Case.fields.id,
      function: "COUNT",
      alias: "count_id"
    )
  ),
  pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 5000)

Feature compatibility

The table below lists this function's compatibility with various features in Appian.
Feature Compatibility Note
Portals Compatible
Offline Mobile Compatible
Custom Record Field Expressions Incompatible
Process Reports Incompatible

You cannot use this function to configure a process report.

Process Events Incompatible

You cannot use this function to configure a process event node, such as a start event or timer event.

Open in Github Built: Mon, Oct 03, 2022 (01:42:07 PM)

On This Page

FEEDBACK