Suppose you have one measure and two dimensions. One dimension is Color (eg. red, green, yellow), the other dimension is Size (e.g. small, medium, large). Maybe the fact table looks like this
PK
Color
Size
Amount
The dimensions are not related to each other. There is no relationship like Category/Subcategory between them. However, you want to offer a hierarchical dimension. What should be done for creating a dimension with such a hierarchy?
My own solution has been as follows:
- create a new table (pk, color, size)
- fill it with all existing combinations of color and size
- in the fact table remove the two foreign keys
- replace them with the correct foreign key to the new table
- then in dimension design the new table with both columns can be used
Of course, creating the table can be avoided by performing all steps on the data view level. But is the general procedure correct? Is there an easier one?
Michael G. Schneider