Hi,
I'm trying to make a simple SUM query but it does not return what I need.
The query returns a datasubset with 2 lines (quantities: 45 and 46), but I was expecting the query to return 91.(I would like to avoid using the sum() function in this example).
Could you tell me what is missing please ?
a!queryEntity( entity: cons!CJT_VEHICLES, fetchTotalCount: true, query: a!query( aggregation: a!queryAggregation( aggregationColumns: { a!queryAggregationColumn( field: "quantity", alias: "quantity", aggregationFunction: "SUM", isGrouping: true ) } ), logicalExpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "type", operator: "=", value: ri!typeId ) }, ignoreFiltersWithEmptyValues: true, ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1 ) ) )
Discussion posts and replies are publicly visible
I think your first issue is that you have "isGrouping" set to TRUE in your aggregation column.
Ok I see, now it works (I've forgot to add a second "queryAggregationColumn" with grouping=true)
Thank you Mike.