SCD type 2 in dbt with window functions only
Dutch municipalities merge almost every year, and a warehouse that only knows the current list quietly rewrites the past. Here is how I versioned the municipality dimension in nl-vehicle-warehouse with lag(), a running sum and a group by — no dbt snapshots, no macros, and a test that guards the one assumption the whole derivation rests on.