a!queryEntity with filter and aggregation

Certified Senior Developer

I'm trying to get a sum total of check amounts for a specific account within a date range. This query locates the correct 'checkAmt' values but I want one total - not 5. I get a series of values:

Received: [startIndex=1, batchSize=-1, sort=[field=checkTotal, ascending=true], totalCount=9, data=[checkTotal:2]; [checkTotal:11]; [checkTotal:22]; [checkTotal:33]; [checkTotal:40]; [checkTotal:65]; [checkTotal:96]; [checkTotal:216]; [checkTotal:452], identifiers=] 

I want to JUST get 937 (the sum of all 'checkAmt' values) 

a!queryEntity(
entity: cons!ABC_CHECK_DS,
query: a!query(
aggregation: a!queryAggregation(
aggregationColumns: {
a!queryAggregationColumn(
field: "checkAmt",
alias: "checkTotal",
aggregationFunction: "SUM",
isGrouping: true
)
}
),
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: -1
),
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "accountNum",
operator: "=",
value: ri!accountNum
),
a!queryFilter(
field: "fiId",
operator: "=",
value: ri!fiId
),
a!queryFilter(
field: "effectiveDateTime",
operator: "BETWEEN",
value: {todatetime(ri!startDate), todatetime(ri!endDate)}
)
}
)
)
)

  Discussion posts and replies are publicly visible

Parents Reply Children