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
Keyword | Type | Description |
---|---|---|
|
Any Type |
Fields to group by using a list of |
|
Any Type |
Calculations to perform using a list of |
Aggregation Fields
a!queryRecordType()
to define the fields returned when aggregating data.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. This is an example of using one grouping and one measure to return the total number of cases for each month.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)
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. This is an example of using no groupings and one measure to return the total number of cases.
1
2
3
4
5
6
7
8
9
10
11
12
a!queryRecordType(
recordType: recordType!Case,
fields: a!aggregationFields(
measures: {
a!measure(
field: recordType!Case.fields.id,
function: "COUNT",
alias: "count_id"
)
}
),
pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 5000)
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. This is an example of using one grouping and no measures to return the distinct status values for each case.
1
2
3
4
5
6
7
8
9
10
11
a!queryRecordType(
recordType: recordType!Case,
fields: a!aggregationFields(
groupings: {
a!grouping(
field: recordType!Case.fields.status,
alias: "case_status"
)
}
),
pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 5000)
Feature | Compatibility | Note |
---|---|---|
Portals | Compatible | |
Offline Mobile | Compatible | |
Sync-Time Custom Record Fields | Incompatible | |
Real-Time Custom Record Fields | 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. |
a!aggregationFields() Function