I have a fact table defined at the order/line grain. Each order belongs to a certain vertical and each vertical has custom attributes for describing it's data. I want to be able to allow users to query across all orders regardless of vertical but when querying for data specific by verticals be able to filter by vertical specific attributes.
Here's how I plan on structuring this but would like input if this seems like a good design or please recommend another approach if this is bad.
The fact table will contain the VerticalKey FK. These are the Dims I'm planning on making:
DimVertical (supertype/core)
- VerticalKey (Auto Increment)
- OrderId (Alternate key)
DimVertical-Car (subtype/custom)
- VerticalKey (Key Id from DimVertical.VerticalKey)
- CustomAttributeABC
- CustomAttributeDEF
- CustomAttributeGHI
DimVertical-Motorcyle (subtype/custom)
- VerticalKey (Key from DimVertical.VerticalKey)
- CustomAttribute123
- CustomAttribute456
In order to query across all orders a join would just be done to the supertype DimVertical. However when I want to query across a specific vertical, by vertical specific attributes, I would just include the optional subtype Dimension.
Does this seem like a good approach? Secondly, if this is a fine approach, let's say "OrderType" is a super type attribute so it could go into the DimVertical dimension, is that bad? I'm questioning that cause I know you are not suppose to have a header dimension which is kind of what this is but I don't know how else to support "custom" order header search ability.
Thanks in advance!