expect_column_values_to_be_increasing

Feb 23, 2026dbt-expectations · Column · Values distribution

How it Works

The expect_column_values_to_be_increasing test from the dbt-expectations package validates that values in a column are monotonically non-decreasing (or strictly increasing, if configured). This is useful for validating sequential IDs, timestamps, or running totals that should always move forward.

The strictly argument (default false) controls whether equal consecutive values are acceptable.

Steps and Conditions

  1. Column Selection: Identify the column to validate.
  2. Optional Sort: Specify sort_column and sort_column_desc to define ordering.
  3. Strictness: Set strictly: true for strictly increasing, false for non-decreasing.
  4. Execution: Each value is compared to the previous row's value.
  5. Outcome: Pass if the sequence is monotonically increasing; fail if any decrease is detected.

Example Usage: Sequence IDs

A data engineering team maintains an event_sequence column that must always increase with each new record inserted.

models:
  - name: event_log
    columns:
      - name: event_sequence
        tests:
          - dbt_expectations.expect_column_values_to_be_increasing:
              strictly: true
              sort_column: inserted_at

Any out-of-order or duplicate sequence values fail the test, alerting the team to event ordering issues.

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.