Aggregations

Aggregations allow to perform simple arithmetic operations on result of some query. Aggregations are only applied to record set returned by query, after all the filters are applied.

Following example calculates maximum, minimum and average value of decimal_value attribute of all deals available for $ACCESS_TOKEN owner.

Note the use of "hits": false parameter - it is used not to fetch query results, since the important part in the response is aggregation result and not single items themselves.


As stated previously, additional filtering can be applied. Following request may be used to calculate average deal value, won by Jane Doe in 2nd quarter of 2017. It contains two main parts: filter for narrowing record set (just as described in filtering section) and aggregation definition to aggregate query results.