database design - Need help modeling a fact table -
I'm taking my first step to datawirehousing.
I am Kimball & amp; Has bought the excellent book "Data Warehouse Toolkit - Third Edition"; Ross, who explained to me how to understand the fundamental concepts.
Today I have started preparing my second data mart, but I'm already struggling with a (maybe stupid) problem, suppose I'm modeling a simple selling event: a small fact sheet Will be:
DATE_ID | CUSTOMER_ID | PRODUCT_ID | QUANTITY Each dimension has many relationships with others, as explained on the book and the web. Next
I want to add some more dimension, like the carrier:
DATE_ID | CUSTOMER_ID | PRODUCT_ID | CARRIER_ID | Quantity Dimensions are still in many-to-many relationships.
Now, I have been asked to add detailed information about the delivery (maybe a dozen or more), a bunch of dates, the number of routing, boxes and palettes, different flags etc., so I have the delivery dimension table Was thinking about. My first attempt was:
DATE_ID | CUSTOMER_ID | PRODUCT_ID | CARRIER_ID | DELIVERY_ID | Quantity But ... surprisingly, the fact sheet is not in many relationships now, so I thought: "Well, I can reapply it, because now Other dimensions are actual properties of distribution ", but this will be
DELIVERY_ID | PRODUCT_ID | Quantity And my fact table will now have 2 dimensions.
Now, in other situations I will treat delivery as a dinerett dimension, but since I have to add a lot to it with the attributes, which route I do not follow: < Ul>
To create a delivery dimension and create a fact table refactor? Throw them into the facts table? Create a delivery dimension and putting DELIVERY_ID in the fact table shows that it is only a thin dimension? Perhaps it is not so easy to choose between dimensions and facts
As you describe it, Distribution is a Sale . Therefore delivery should be a separate fact sheet. Of course you always have a "project" (to say this) in one dimension, if you do not need additional complexity, for example, say that you only know some simple facts about delivery Needed: For example the carrier and delivery date. So you can use DELIVERY_ID in sales and you can register these information in the delivery dimension.
But if you have to register the complete complication of delivery (two or more delivery related to a sale can be done, and two or more sales relative to a distribution) you need two fact tables.
Comments
Post a Comment