name: op-agg-sum
description: Sum the numeric values of a field across the input set.
kind: operator
category: AGG
operator: AGG_SUM
type: reference
applies_to: process, compose, predict
examples_tags: [financial, streaming-friendly]
Use when
Total of a numeric field, over all rows or per group.
Questions it answers:
- What is total revenue by region?
- How many units did each product line sell in total?
Use something else:
AGG_AVERAGEwhen you want the typical value per row rather than the total.AGG_WEIGHTED_MEANwhen rows carry weights and you want a weighted average.WIN_RUNNING_SUMwhen you want the total so far, row by row.
Params
Weighted: Σw·x.
Inputs
field — admitted types: see ## Contract.
Output
Scalar float64; over decimal128 a decimal string (banker-rounded precision propagation). One row per group when wired under a grouper.
Components
sum— Running sum of non-null values
Contract
- Types (
field):date,datetime,decimal128,f32,f64,packed_bool,u16,u32,u4,u64,u8; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED. - Weight: weighted under
frequencyandprobabilityweights. - Streaming: streamable; components
mergeable. - Components:
n,n_null,sum; optionalsum_weights,n_eff,n_weight_invalid.
Gotchas
- Smart default for numeric fields when
typeis omitted. - Order-free binned sum: serial, any
DecodeWorkers/ShardWorkerscount and any shard split give the same bits (not correctly rounded; error ≲ 7ε·|sum|). - Empty input (all null / no rows) sums to
0("0.00"ondecimal128), never null: the empty sum is defined. Detect emptiness byn == 0in the components floor. decimal128under any weight in force (default included) →PULSE_WEIGHT_UNSUPPORTED;"weight": nullopts out.
See
pulse_examples_search tags=[financial]- Skills:
aggregation-design,response-components