Retail conformed dimensions
Build orders and returns facts that share conformed customer, product, and date dimensions, with product versioned as Type 2.
Concept
conformed-dimensions
The primary modeling idea this problem reinforces.
Requirements
5
Business needs the model must satisfy.
A retailer wants net-of-returns revenue and margin by customer and product, with product list price reflected as it was at sale time. Orders and returns are separate processes; the customer and date dimensions exist, and product currently overwrites price in place.
Real enterprise models combine patterns: conformance makes orders and returns comparable, while a Type 2 product dimension keeps historical price correct. Getting one without the other produces wrong net revenue.
- Add orders and returns facts at their own grains.
- Share the customer, product, and date dimensions across both facts.
- Floor: make the product dimension Type 2 with an effective-from so price versions are preserved.
- Reference each dimension through surrogate-key foreign keys.
- Grade up: bound each product version with an effective-to so validity windows are explicit.
Template
Retail synthesis starter
The model users start from in the full workspace.
Entities
3
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.