slowly-changing-dimensions

Implement dbt models and snapshots for SCD Types 1, 2, and 3.

1|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/nrakow/ae-skills-dev --skill slowly-changing-dimensions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: slowly-changing-dimensions
Source: https://github.com/nrakow/ae-skills-dev/tree/main/skills/slowly-changing-dimensions
Command: npx skills add https://github.com/nrakow/ae-skills-dev --skill slowly-changing-dimensions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design and implement Slowly Changing Dimensions (SCD) patterns to track attribute history across data warehouses using dbt snapshots.

Core Features & Use Cases

  • Type 1: Overwrite current attribute values when corrections occur.
  • Type 2: Add new row for each change to preserve history and enable point-in-time joins.
  • Type 3: Track one prior value for quick comparisons.
  • Use Cases: When auditing customer attributes, pricing history, or policy changes over time; build accurate BI and analytics that reflect historical context.

Quick Start

Run the dbt snapshot for Type 2 history, then validate results with tests.

Frequently Asked Questions about slowly-changing-dimensions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I track slowly changing dimensions in dbt to preserve historical data?

Slowly changing dimensions in dbt are tracked using snapshots to capture attribute changes over time, preserving historical context for accurate point-in-time analytics. You configure dbt snapshots to detect source data changes and apply SCD Type 1, 2, or 3 patterns accordingly.

What is the difference between SCD Type 1, Type 2, and Type 3 patterns?

SCD Type 1 overwrites current values for corrections, Type 2 adds a new row for each change to preserve full history, and Type 3 tracks one prior value for quick comparisons. Choosing the right pattern depends on source data characteristics and your analytical requirements.

How do I implement point-in-time joins for historical analytics using dbt snapshots?

Point-in-time joins are implemented by querying dbt snapshot outputs, which contain start and end timestamps for each historical record. These timestamps allow downstream analytics to join fact data with the correct dimensional attributes active at any specific historical moment.

Can I use dbt snapshots for both current and historical data tracking?

Yes, dbt snapshots maintain both current and historical records by automatically tracking effective dating. Validation and testing guardrails ensure correct segregation of current versus historical rows, enabling accurate reporting on current states and past changes.

When should I use SCD Type 2 instead of Type 1 for data modeling?

Use SCD Type 2 when you need to preserve a full history of changes for auditing or point-in-time analysis, such as tracking customer attributes or pricing history. Use Type 1 when you only need the most recent corrected value and do not require historical tracking.

What testing and validation guardrails are needed for dbt snapshot configurations?

Snapshot configurations require validation tests to ensure historical tracking accuracy and prevent data gaps. Guardrails verify that snapshot updates correctly capture changes, maintaining the integrity of current versus historical records for downstream models.