Aggregates
The :agg operator permits the use of aggregate functions, such as count, sum and so on. See below for a listing of what you can do.
Stats
maxthe max val by some expr.minthe min val by some expr.rel/max-bythe max row by some expr.rel/min-bythe min row by some expr.
Top or bottom N
rel/bottomfind the lowest n vals for some expr.rel/bottom-byfind the lowest n rows for some expr.rel/topfind the biggest n vals for some expr.rel/top-byfind the biggest n rows for some expr.
Counts
countrow count, or row count for all rows meeting some predicate.rel/count-distinctval count for all distinct vals of some expr.
Other
rel/any/rel/not-anycheck if any row meets a predicate (or not).rel/sumsum over some expr.rel/set-concatbuild sets by some expr over grouped rows.