Shrunken month dimension
Share one month-grain (shrunken) date dimension between a forecast fact and an actuals fact so variance lines up period for period.
Concept
conformed-dimensions
The primary modeling idea this problem reinforces.
Requirements
3
Business needs the model must satisfy.
Finance forecasts revenue monthly and records actual revenue monthly. They want plan-versus-actual variance by fiscal period. A month-grain date dimension already exists as a rollup of the daily calendar; the two monthly facts do not.
A shrunken conformed dimension is a rollup of a base dimension to a coarser grain. Both monthly facts must share it, or plan and actual land on mismatched periods and variance becomes meaningless.
- Add a monthly forecast fact and a monthly actuals fact at month grain.
- Reference the existing month dimension from both facts.
- Declare surrogate-key foreign keys and N:1 relationships from each fact to the month dimension.
Template
Shrunken month dimension starter
The model users start from in the full workspace.
Entities
1
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.