Skip to content

Aggregation Comparison Anomaly Reporting

How the Aggregation Comparison check reports a failed comparison: the anomaly message it produces, how the two evaluated values are rendered, and why per-row reporting does not apply to this rule.

Anomaly Messages

Aggregation Comparison emits Shape Anomalies only: one anomaly per failed comparison, never per row. When the comparison fails and both aggregates evaluated successfully, the message is:

<expression> evaluates to <observed>, which is not <comparison> <reference expression> at <expected>

<comparison> is the long form of the operator: less than, less than or equal to, equal to, greater than or equal to, or greater than.

When either aggregate yields NULL, NaN, or an infinite value, that side renders as null/NaN in the message and the comparison is reported as failing.

When the reference expression is filtered, the message adds a sentence naming each filter against the expression it applied to, such as The comparison applied load_date = current_date() to COUNT(*) and updated_at >= current_date() to COUNT(*). With a filter on the reference alone it reads The comparison applied <reference filter> to <reference expression> only. When only the target is filtered, the first sentence ends with (applied to records where <expression>) instead.

How the Values Are Rendered

Both evaluated values are shown in the message exactly as computed, with the formatting below:

  • Whole numbers drop the decimal part (1500, not 1500.00).
  • Fractional values keep their significant digits and drop trailing zeros (1500.75).
  • A value that could not be evaluated renders as null/NaN.

Rounding the expression itself (for example, ROUND(SUM(amount), 2)) is the reliable way to control precision on both sides of a reconciliation.

Source Records Behavior

Aggregation Comparison does not evaluate individual rows, so the Shape Anomaly carries no source records. The two evaluated values in the message are the evidence: compare them against the expressions to find where the reconciliation broke.

Custom Anomaly Description

Custom Anomaly Description does not apply to this rule. The option replaces the message on Record Anomalies, and Aggregation Comparison emits none. The toggle can still be set on the check form, but Shape Anomalies always use the fixed message described above.

See Also