expect_column_values_to_be_decreasing
Feb 24, 2026
·
5
min read
Values distribution
·
dbt-expectations
·
Column
How it Works
The expect_column_values_to_be_decreasing test from the dbt-expectations package validates that values in a column are monotonically non-increasing (or strictly decreasing if configured). This is the counterpart to expect_column_values_to_be_increasing and is useful for validating descending rankings, countdown sequences, or metrics that should always decrease over time within a given partition.
The strictly argument (default false) controls whether equal consecutive values are acceptable.
Steps and Conditions
Column Selection: Identify the column to validate.
Optional Sort: Specify
sort_columnandsort_column_descto define ordering.Strictness: Set
strictly: truefor strictly decreasing,falsefor non-increasing.Execution: Each value is compared to the previous row's value.
Outcome: Pass if the sequence is monotonically decreasing; fail if any increase is detected.
Example Usage: Rank Tables
A competitive gaming platform generates weekly player rankings ordered from highest to lowest score. The rank column should always decrease (i.e., go from 1 toward the bottom).
Any increase in score down the ranked list would indicate a data ordering error in the ranking model.





