Basic Model Retail Grocery Store l l Process
Basic Model: Retail Grocery Store l l Process: Retail Sales Grain: POS line item Dimensions: Date, Store, Product, Promotion Facts: Sales Quantity, Sales Dollar Amount, Cost Dollar Amount, Gross Profit Dollar Amount.
Model DATE Date. Key Attributes STORE Store. Key Attributes POS FACT Date. Key Product. Key Store. Key Promotion. Key POSTransaction. Number Sales. Quantity Sales. Dollar. Amount Cost. Dollar. Amount Gross. Profit. Dollar. Amount PRODUCT Product. Key Attributes PROMOTION Promotion. Key Attributes
Possible Date Attributes l l l l l SQL date Full date description Day of week Day of month Day of calendar year Day of fiscal year Month of calendar year Month of fiscal year Calendar Quarter Fiscal Quarter l l l Fiscal week Year Month Fiscal year Holiday ? Holiday name Day of holiday Weekday ? Selling season Major event etc.
Possible Product Attributes l l l l l Description SKU number Brand description Department Package type Package size Fat content Diet type Weight l l l l Weight units of measure Storage type Shelf unit type Shelf width Shelf height Shelf depth etc.
Possible Store Attributes l l l l l Store Name Store Number Street address City County State Zip Manager District l l l l l Region Floor plan type Photo processing type Financial service type Square footage Selling square footage First open date Last remodel date etc.
Possible Promotion Attributes l l l l Promotion name Price reduction type Promotion media Ad type Ad agency Display type Coupon type Promotion cost l l l Begin date End date etc.
Factless Fact Tables l In order to evaluate promotions that might have generated no sales we need another approach. Promotion could generate another fact table (or could be considered a fact table in itself). That new fact table would have no additive attributes.
Conformed Dimensions: Inventory Snapshot Model l l Process: Store inventory Grain: Daily inventory by product and store Dimensions: Date, product, store Fact: quantity-on-hand
Dimensional Model DATE Date. Key Attributes Inventory Fact Product. Key Date. Key Store. Key Quantity. On. Hand Quantity. Sold Value. At. Cost Value. At. Selling. Price PRODUCT Product. Key Attributes STORE Store. Key Attributes Note: Quantity. On. Hand is semi-additive. It is additive across product and store, but not across date. The other attributes are additive.
Conformed Dimensions l Common dimensions for different processes should be the same. Note: Dimensions for roll-up or aggregated fact tables my add or eliminate attributes based on the aggregation Where attributes apply, they should mean the same thing.
The Bus Matrix Date Product Store Promotion Warehouse Vendor Retail Sales X X Retail Inventory X X X Retail Deliveries X X X Warehouse Inventory X X Warehouse Deliveries X X Purchase Orders X X Contract Shipper X X Process
Slowly Changing Dimensions Attributes in a dimensional table that change over time. Three approaches Type 1: overwrite the old value Type 2: create a new dimensional record Type 3: create a “previous value” attribute
Examples Original Type 1 Type 2 Type 3 Product. Key Description Category SKU 21553 Leap. Pad Education LP 2105 Product. Key Description Category SKU 21553 Leap. Pad Toy LP 2105 Product. Key Description Category SKU 21553 Leap. Pad Education LP 2105 44631 Leap. Pad Toy LP 2105 Product. Key Description Category Old. Cat SKU 21553 Leap. Pad Toy Education LP 2105 Product. Key Description Category Old. Cat SKU 21335 Leap. Pad Electronics Education LP 2105 44631 Leap. Pad Electronics Toy LP 2105 68122 Leap. Pad Education Electronics LP 2105 Hybrid
More about dimensions l Views for dimensions used for different purposes l l l e. g. Start. Date and End. Date Junk dimensions for flags and miscellaneous categories removed from the fact table Degenerate dimensions have no attributes l Usually reserved for order number or something similar
Accumulation Snapshot l l State change summary that has one row per item. Access rows on each update.
Multiple Granularities l l Product sales vs. Annual quota Line item cost vs. Order shipping cost
- Slides: 17