In the DW world, the word "dimension" is overloaded -- changes meaning depending on context. Here is an example.
- On a certain date, a customer walks into a store and buys a product.
This example has four dimensions (date, customer, store, product) and one fact (sales). So a typical Kimball star would look like:
A dimension (table) is a look-up table for properties of objects that rarely change. Product, customer and store may change some of their properties (attributes), but they rarely do. Fact table captures interactions between these objects. At the intersection of dimensions date, store, product and customer lies a measure SalesAmount
. Note how easy is to aggregate (sum) the sales amount by date, by year, by product, by brand, by city, by country, by age group, by whatever -- which was the idea in the first place.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…