Type 3: Keep Previous Value

Type 3 keeps history in a column. The dimension gains a previous_ column next to the tracked attribute, and usually a date for when the switch happened. On a change, the current value moves into the previous column and the new value takes its place. The table stays at one row per entity.

A change that hits everyone at once

On July 1, 2025 the marketplace redraws its sales regions. Iberia is folded into a new Southern Europe region, and DACH becomes Central Europe. Regional managers hold targets set under the old map and need this year's reports under both maps while they adjust. Every host changes on the same day, for the same reason, and the business wants the old and new labels side by side.

UPDATE dim_host
SET
    previous_region = region,
    region = 'Southern Europe',
    region_changed_on = DATE '2025-07-01'
WHERE region = 'Iberia'

In standard SQL, each SET expression reads the row as it was before the statement ran, so previous_region receives Iberia. The tables in this section use a one-row-per-host dim_host so the Type 3 columns stand alone.

host_idhost_nameregionprevious_regionregion_changed_on
4417Marta ReisSouthern EuropeIberia2025-07-01
5230Jonas WeberCentral EuropeDACH2025-07-01

Read one row as: this host, with the region they belong to now and the region they belonged to before the latest change. Both values sit on the same row, so both reach every fact through the ordinary join.

SELECT
    d.region,
    d.previous_region,
    SUM(f.amount) AS total_revenue
FROM fact_booking f
JOIN dim_host d
    ON f.host_key = d.host_key
GROUP BY
    d.region,
    d.previous_region
regionprevious_regiontotal_revenue
Southern EuropeIberia1400
Central EuropeDACH400

This is the report Type 3 exists for. All of Marta's bookings, February through April, total 1400 under Iberia and the same 1400 under Southern Europe. A Type 2 table gives each booking one region, the one in force on its date, so totaling everything under the old map takes a second join pinned to a date. Type 3 treats the 2 values as alternate labels for the same facts.

The limit of a single previous column

The column holds one earlier value. Suppose Southern Europe is renamed Mediterranean in 2026. The update moves Southern Europe into previous_region, and Iberia is gone.

Afterregionprevious_region
Initial loadIberiaNULL
July 2025 redrawSouthern EuropeIberia
2026 renameMediterraneanSouthern Europe

Adding previous_region_2 postpones the problem and widens the table for every tracked attribute. A second limit is per-fact truth. Which region applied to a given booking is missing from the row. Comparing booking_date with region_changed_on recovers it for the latest change and for nothing earlier.

Type 2 answers
  • Which value was in force when this fact happened?
  • How many times has this host changed, and when?
  • What did the dimension look like on a given past date?
Type 3 answers
  • What do all facts total under the previous labels?
  • Which entities moved in the latest change?
  • How do the old and new groupings compare over one period?

Type 3 fits a narrow profile. Changes are rare and planned, they often hit many rows on one date, and people want to compare 2 labelings of the same facts during a transition. Hosts changing tier at different times, several times each, are the opposite profile.

A streaming service keeps plan and previous_plan on its one-row-per-member dimension. A member moves from Basic to Standard in 2024, then from Standard to Premium in 2025. Finance asks how much this member paid while on Basic. What can the dimension contribute?

A previous-value column is the smallest history a dimension can hold. It works while the question is old labels against new labels, and it fails as soon as someone asks about the value before last.

About this lesson

This section is part of the Change Tracking lesson on DataDriven, the home of data engineering. Lessons cover SQL, Python, Spark, data modeling and pipeline architecture, and each section pairs its explanation with worked examples and practice you run as you go.