Skip to content

How Sum Checks Work

Definition

Asserts that the sum of a numeric field equals a specific value.

Overview

The Sum rule adds up every value in a numeric column and compares the total against the number you configure. The comparison is an exact equality: the check passes only when the two match.

This is an aggregate rule. It says nothing about any individual row, only about what they add up to, which is exactly what a reconciliation against a control total needs.

Typical use cases:

  • Reconcile a loaded batch against a control total supplied with the delivery.
  • Confirm an allocation splits a known amount without losing or inventing value.
  • Verify that a set of weights or percentages adds up to the total it must.

Field Scope

Single: The rule evaluates one numeric field per check and adds up its values across the filtered rows.

Accepted Types

Type Supported
Integral
Fractional

Anomaly Types

Type Supported
Record
Flag inconsistencies at the row level
Shape
Flag inconsistencies in the overall patterns and distributions of a field

Evaluation Flow

Every Sum check follows the same three-step evaluation flow:

  1. Apply the filter clause. If the check has a filter set, only rows matching the filter expression are added up. Rows outside the filter contribute nothing to the total.
  2. Add up the column. The platform sums the field's values across the filtered rows. Rows where the field is empty contribute nothing, which is the same as contributing zero.
  3. Compare the total against the expected value. The check passes when the two are exactly equal. Any difference, however small, produces a Shape Anomaly reporting both numbers.

The Comparison Is an Exact Equality

There is no tolerance property on this rule. The computed total must equal the configured value exactly, which makes Sum well suited to whole-number control totals (a record count, a unit count, an integer amount in cents) and awkward on values that went through division or currency conversion.

When a total is genuinely allowed to move within a margin, Aggregation Comparison expresses the comparison with an operator rather than a fixed equality.

The Rule Evaluates the Column, Not the Rows

Sum produces one verdict for the whole filtered set. It cannot point at a row, because no single row is wrong: the total is. That is why the anomaly carries two numbers and no source records.

When you also need to know which rows are implicated, pair the check with a per-row rule on the same field, such as Between or Not Negative.

Empty Values Contribute Nothing

A row where the field is empty adds nothing to the total, exactly as if it held zero. The check therefore cannot distinguish "the value is missing" from "the value is zero".

When the difference matters, add a Not Null check on the same field so a missing value is reported in its own right.

Coverage Does Not Change the Outcome

The form shows a Coverage slider because it is part of the shared check form, but Sum compares one aggregate against one value. There is no per-row pass rate for a threshold to relax, so the setting does not affect whether the check passes.

The Filter Clause

The filter clause is a SQL WHERE expression applied before the evaluation. Filtered-out rows are ignored entirely.

When a filter is set, the Shape Anomaly message ends with [filter: <expression>] so the evaluated scope is visible in the alert.

See Also