Skip to content

sum

The :sum aggregate function, sums over numeric columns in a group.

Takes an expression as an argument.

For example, lets total across all the orders.

;; QUERY 
[[:from :Order] 
 [:agg [] [:total [rel/sum :total]]]

;; STATE 
{:Order #{{:total 10.0M}, {:total 15.30M}}}

;; RESULTS
({:total 25.30M})