According to The Data Warehouse Toolkit by Kimball
"The grain must be declared before choosing dimensions or facts because every candidate dimension or fact must be consistent with the grain."
I'm so confused about this concept .Could some one illustrate what's the meaning of Grain
giving an analogy or metaphor in real life to clarify the concept .
Some examples:
Hence the time dimension must support HOUR and DAY, and the product dimension must support PRODUCT and PRODUCT_CLASS.
The grain (or granularity of the fact) refers to the 'level' at which you're taking a measurement. A fact table describes a measurement taken of a business process, so the best way to describe the grain is to describe what you get for each row. The classic example for a supermarket checkout is 'one row for every beep/scan'. This is better than saying 'one row for every day, product and store' (i.e. naming the dimensions) because it grounds it in reality.
The grain/level element is that you might be storing a row at a level of product, or you might be storing it at some grouping of products. This matters as it will determine whether you can use the product-level dimension or the group-level dimension with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With