Example
Setup: Previous ETL covered 2020-01 to 2022-06. Current ETL covers 2020-01 to 2022-12.
Months added is calculated as:
DIFFMIN = new.DP_MinDate - old.DP_MinDate = 0 months
DIFFMAX = new.DP_MaxDate - old.DP_MaxDate = 6 months
MonthsAdded = DIFFMIN + DIFFMAX = 6
6 months added → threshold tier 5–12: overall_count_threshold_low = 5%, overall_count_threshold_high = 10%, propdiff_threshold = 1%.
Proportional difference is calculated as:
PROP_DIFF = (new_count / variable_denom_new) - (old_count / variable_denom_old)
Where variable_denom is the total record count for the table being checked, sourced from all_l1_record_counts.
Scenario A — WARN (percent change above low threshold, proportional difference below threshold):
DTH table: old = 9,600 records, new = 10,272 records, table denominator = 500,000.
- PCT_CHANGE =
(10,272 - 9,600) / 9,600 × 100 = 7% → exceeds overall_count_threshold_low (5%) ✓, below overall_count_threshold_high (10%) ✗
- PROP_DIFF =
(10,272 / 500,000) - (9,600 / 500,000) = 0.02054 - 0.01920 = 0.00134 (0.13%) → below propdiff_threshold (1%) ✗
One metric exceeded → WARN
Scenario B — CRIT via dual threshold (both metrics exceeded):
DTH table: old = 9,600 records, new = 10,272 records, table denominator = 50,000.
- PCT_CHANGE = 7% → exceeds
overall_count_threshold_low (5%) ✓, below overall_count_threshold_high (10%) ✗
- PROP_DIFF =
(10,272 / 50,000) - (9,600 / 50,000) = 0.20544 - 0.19200 = 0.01344 (1.34%) → exceeds propdiff_threshold (1%) ✓
Both metrics exceeded → CRIT
Scenario C — CRIT via overall_count_threshold_high alone:
DTH table: old = 9,600 records, new = 10,656 records, table denominator = 500,000.
- PCT_CHANGE =
(10,656 - 9,600) / 9,600 × 100 = 11% → exceeds overall_count_threshold_high (10%) ✓
Percent change alone exceeds the high threshold → CRIT (proportional difference is not evaluated)