SCD strategy per attribute
Apply Type 1, Type 2, and Type 3 choices to different attributes in one account dimension.
Concept
slowly-changing-dimensions
The primary modeling idea this problem reinforces.
Requirements
4
Business needs the model must satisfy.
A SaaS revenue team uses account context for subscription analysis. Account name corrections should overwrite in place, plan tier must be historically accurate for subscription events, and sales wants current territory plus one previous territory after a realignment.
Real dimensions rarely use one SCD treatment for every attribute. The modeling skill is choosing the lightest history pattern that still supports each business question.
- Keep account id and account name on the account dimension.
- Model plan tier with Type 2 effective dates and current-row flag.
- Add previous_territory for the Type 3 territory requirement.
- Connect subscription events to the account surrogate key.
Template
Mixed account SCD starter workspace
The model users start from in the full workspace.
Entities
2
Seeded tables visible in the public preview.
Dialect
postgresql
Generated SQL target for this starter model.
This preview is read-only. Open the workspace to edit and verify; saving needs a free account.
Open workspaceTry the question first.
The discussion has other people's approaches and solutions. Give it a real attempt before you read them.