Dimension fields depend on other fields
2 posters
Page 1 of 1
Dimension fields depend on other fields
I am creating dimension of product properties for sales facts.
Property of product depend of product type. For example:
- Type = smartphone. Properties = model, OS, size
- Type = book. Properties = author, title
How dimension should be for this case?
Should I create dimension which contain ALL properties? In this case dimension content will be sparse, there will be many null values.
OR, should I create dimension for each? In this case sales fact will have many FKs.
Is there any other way to do this?
Property of product depend of product type. For example:
- Type = smartphone. Properties = model, OS, size
- Type = book. Properties = author, title
How dimension should be for this case?
Should I create dimension which contain ALL properties? In this case dimension content will be sparse, there will be many null values.
- Code:
|----------------------------------------------------|
| DimKey | Type | Model | OS | Size | AUTHOR | TITLE |
OR, should I create dimension for each? In this case sales fact will have many FKs.
- Code:
|-------------------------------------------------------------|
| FactKey | Quantity | Total | Book_FK | Smartphone_FK | .... |
Is there any other way to do this?
rendybjunior- Posts : 7
Join date : 2014-09-30
Re: Dimension fields depend on other fields
You could use sub-types. That is, a product dimension with the common, generic attributes, as well as sub-type dimensions with additional columns for specific types of products. The primary key would be the same for the product dimension and it's sub-type, so you need only a single key in the fact.
If someone is doing an analysis of products, they would just join to product and work with the common attributes. If someone is doing an analysis of books they would use the product and book dimensions. Since the book dimension only contains books, it would naturally filter out all non-book products from the query.
If someone is doing an analysis of products, they would just join to product and work with the common attributes. If someone is doing an analysis of books they would use the product and book dimensions. Since the book dimension only contains books, it would naturally filter out all non-book products from the query.
Re: Dimension fields depend on other fields
awesome. thanks!
rendybjunior- Posts : 7
Join date : 2014-09-30
Similar topics
» Y/N fields in dimension or as measure with 0 and 1 (or both)?
» employee dimension - adding extra fields
» How to model dimension data including dynamic fields from the OLTP system?
» Always link date fields to Date Dimension?
» Miscellaneous Fields
» employee dimension - adding extra fields
» How to model dimension data including dynamic fields from the OLTP system?
» Always link date fields to Date Dimension?
» Miscellaneous Fields
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum