Intermediate TrackBack
Intermediate
🚀
Introduction to SCDs
Understanding why and when to track dimensional changes.
Section 1 of 2: The History Problem0%
The History Problem
Study Material
Why Do We Need Slowly Changing Dimensions?
Dimension data changes over time. Customers move, products get repriced, employees change departments. The fundamental question is: how should we handle these changes?
Real-World Scenario:
Sarah, a customer, moves from New York to California on March 15th.
In Q1, Sarah made 3 purchases while in New York.
In Q2, Sarah made 5 purchases while in California.
The Business Questions:
- 1"What were total sales by state in Q1?"
- Should Sarah's Q1 sales count as NY or CA?
- 1"What were total sales by state for the full year?"
- How do we handle Sarah's sales accurately?
- 1"How many customers do we have in each state TODAY?"
- Is Sarah a NY customer or CA customer?
Two Different Truths:
- Point-in-Time Truth: Sarah WAS in NY when she made Q1 purchases
- Current Truth: Sarah IS currently in CA
Both are correct! The question is: which truth does the business need?
Why This Matters for Analytics:
Without proper SCD handling:
- Q1 sales might be attributed to CA (wrong!)
- Historical reports change every time data refreshes
- Audit requirements fail
- Customer journey analysis impossible
With proper SCD handling:
- Historical accuracy preserved
- Reports are reproducible
- Compliance requirements met
- Full customer lifecycle visible
Common Scenarios Requiring SCDs:
- Customer address/contact changes
- Product price/category updates
- Employee department/title changes
- Store region reorganization
- Organizational restructuring
- Pricing tier changes