Data Quality Tests — opportunities Model
Generated from Scope × Basis matrix on 2026-06-29.
Tests Generated
Row-level, Absolute
- stage enum validation (
schema.yml)- Ensures
stagecolumn values are in the allowed set:prospecting,qualified,closed_won,closed_lost - Type:
accepted_values(dbt built-in) - Severity: error
- Ensures
Aggregate-level, Relative
- monthly sum within 2 std-dev (
tests/aggregate_monthly_amount_within_2std.sql)- Ensures
sum(amount)for the current month falls within 2 standard deviations of the trailing 12-month average - Type: custom SQL test
- Severity: error
- Ensures
Coverage Summary
Scope:
Row-level: ✓ (1 test)
Aggregate-level: ✓ (1 test)
Transformation-level: ✗ (0 tests — not in matrix)
Basis:
Absolute: ✓ (1 test)
Relative: ✓ (1 test)
Temporal: ✗ (0 tests — not in matrix)
Human: ✗ (0 tests — not automatable)
Files
schema.yml— dbt schema with column-levelaccepted_valuestesttests/aggregate_monthly_amount_within_2std.sql— custom SQL test for aggregate relative check
Notes
- The aggregate test assumes an
order_datecolumn (adjust column name if different) - The test uses
CURRENT_DATEfor "current month" — verify this aligns with your pipeline's time zone and refresh schedule - Snowflake syntax; adapt
DATE_TRUNC,STDDEV_POPif using a different warehouse