dimension_anomalies
How it Works
The dimension_anomalies test from the Elementary dbt package monitors the distribution of values within a categorical column over time. Rather than tracking total volume, it watches the relative share of each category and raises an alert if any dimension's proportion shifts unexpectedly. This is particularly useful for detecting silent data quality issues like one source suddenly dominating a feed or a category disappearing entirely.
Steps and Conditions
- Column Selection: Specify the categorical column to monitor using
dimensions. - Baseline Period: Elementary uses historical distributions to establish expected proportions.
- Execution: The current distribution is compared against historical baselines.
- Outcome: Pass if proportions are within normal variance; fail if a significant shift is detected.
Example Usage: E-commerce
An e-commerce platform monitors the distribution of payment_method values. A sudden drop in credit card payments or spike in gift card usage could indicate a payment integration issue.
models:
- name: orders
tests:
- elementary.dimension_anomalies:
dimensions:
- payment_methodIf one payment method's share shifts dramatically overnight, the test raises an alert for investigation.
Interested to Learn More? Try Out the Free 14-Days Trial
One AI-native workspace to build, ship, and monitor dbt™ — without the tool sprawl.
Join industry leaders winning with DinoAI agents
Data engineers and analysts at the most AI-native startups and enterprises use Paradime's DinoAI agents everyday to become market leaders.