Docsity

Case Studies-Data Warehousing and Data Mining-Lecture 03 Slides-Computer Science, Appunti di Basi di Dati

Anteprima parziale del testo

Scarica Case Studies-Data Warehousing and Data Mining-Lecture 03 Slides-Computer Science e più Appunti in PDF di Basi di Dati solo su Docsity!

Data Warehousing and Data Mining

– Case Studies –

Acknowledgements: I am indebted to Michael Böhlen for providing me his

slides, upon which these lecture notes are based.

• Inventory

• Order Management

• OncoNet

• MEDAN

  • Consider a large grocery chain with a central warehouse and several retail stores
  • Advanced retail business requires inventory information.  (^) Making sure the right product is in the right store at the right time minimizes out-of-stocks and reduces overall inventory carrying costs.  (^) The retailer needs the ability to analyze daily quantity-on- hand inventory levels by product and store.
  • Design dimensional models that support the analysis of inventories for retail businesses (grocery stores).
  • 3 different inventory models  (^) Inventory periodic snapshot  (^) Inventory transactions  (^) Inventory accumulating snapshot
  • Model 1: Inventory Periodic Snapshot  (^) Every day (or at some other regular time interval) the inventory levels of each product is measured and stored as a new row in the fact table
  • Business process: Analysis of retail store inventory
  • Granularity: Daily inventory by product at each individual store
  • Dimensions: Date, product, and store
  • Facts/measures: Quantity on hand Date Dimension Date key (PK) Date Attributes ... Store Inventory Snapshot Fact Date Key (FK) Product Key (FK) Store Key (FK) Quantity on Hand Store Dimension Store Key (PK) Store Attributes ... Product Dimension Product Key (PK) Product Attributes ...
  • The quantity on hand is a semi-additive measure  (^) Can be summarized across products and stores, but not across time  (^) Different in POS Retail Sales table: Sold entities are counted only once
  • All measures that record a static level (inventory, financial account balance, measures of intensity e.g., temperature) are inherently non-additive across time and possibly other dimensions.  (^) Can be aggregated along time dimension by averaging
  • A note about SQL AVG function  (^) Cannot be used to compute the average over time, since it averages over the number of rows  (^) Avg inventory over a cluster of 3 products in 4 stores across 7 days would divide the summed value by 84
  • Model 2: Inventory Transactions  (^) Record every transaction that affects inventory
  • Inventory transactions in the store chain  (^) Receive product  (^) Place product in to inspection hold  (^) Release product from inspection hold  (^) Return product to vendor due to inspection failure  (^) Place product in bin  (^) Authorize product for sale  (^) Pick product for shipment  (^) Ship product to customer  (^) Receive product form customer  (^) Return product to inventory from customer return  (^) Remove product from inventory
  • Model 3: Inventory Accumulating Snapshot  (^) One row in the fact table for each shipment of a particular product to the warehouse  (^) This row tracks the disposition of the shipment through the warehouse u (^) i.e., provides an updated status of the shipment as it moves through the warehouse
  • Assume that the inventory goes through a series of events, e.g., receiving, inspection, bin placement, authorization to sell, picking, boxing, and shipping.
  • Model Date Received Dimension Warehouse Inventory Accumulating Fact Date Received Key (FK) Date Inspected Key (FK) Date Placed in Inventory Key (FK) Date Authorized to Sell key (FK) Date Picked Key (FK) Date Boxed Key (FK) Date Shipped Key (FK) Date of Last Return Key (FK) Product Key (FK) Warehouse Key (FK) Vendor Key (FK) Quantity Received Quantity Inspected Quantity Returned to Vendor Quantity Placed in Bin Quantity Authorized to Sell Quantity Picked Quantity Boxed Quantity Shipped Quantity Returned by Customer Quantity Returned to Inventory Quantity Damaged Quantity Lost Unit Cost Unit List Price Unit Average Price Unit Recovery Price Product Dimension Date Picked Dimension Date Authorized to Sell Dim Date Placed in Inventory Dim Date Inspected Dimension Date Boxed Dimension Date Shipped Dimension Date of Last Return Dim Vemdpr Dimension Warehouse Dimension
  • Data Warehouse Bus Architecture  (^) A standard bus interface for a data warehouse environment that allows to implement separate data marts that can be successfully integrated  (^) Based on conformed (similar) dimensions that are shared by the data marts
  • Guides the overall design and breaks down the development process into small chunks (DMs)
  • Data Warehouse Bus Matrix  (^) Tool to create and document the bus architecture  (^) Rows represent business processes (translate into DMs)  (^) Columns represent a suite of standardized dimensions
  • Conformed Dimension  (^) Either identical or strict mathematical subsets of the most granular, detailed dimension  (^) Have consistent dimension keys, and consistent column names and values
  • Roll-up dimensions conform to the base-level atomic dimension  (^) Brand table is a strict subset product table Product Dimension Product Key (PK) Product Description SKU Number Brand Description Subcategory Description Category Description Department Description Package Type Description Package Size … and more Brand Dimension Brand Key (PK) Brand Description Subcategory Description Category Description Department Description

Conforms

Order Management Example/

• Order management consists of several critical

business processes (order, shipment, invoice

processing, etc.) and measures (sales volume,

invoice revenue, etc.)

• Warehouse bus matrix

Order Management Example/

• Role-playing: When a single dimension appears

several times in the same fact table,

 e.g., order date and requested ship date

• Should not be FK to the same dimension table

 SQL would require the two dates to be the same

 We might want to constrain the two dimensions differently

• Might be one physical table, but each of the roles

should be defined as a view with different labels

Order Date Dimension Order Date Key (PK) Order Date Order Date Day of Week ... Requested Ship Date Dimension Requested Ship Date Key (PK) Requested Ship Date Requested Ship Date Day of Week ... Date Dimension Date Key (PK) Date Date Day of Week ...

create view ... create view ...

Order Management Example/

• Multiple hierarchies often coexist in a dimension

table, especially for customer-oriented dimensions

 Natural geographic hierarchy

 Zip Code defines a second hiearchy

• Can have different number of levels

• Should all be supported in a DW

Customer Ship To Dimension Customer Ship to Key (PK) Customer Ship To ID (NK) Customer Ship To Name Customer Ship To Address Customer Ship To City Customer Ship To State Customer Ship To Zip + 4 Customer Ship To Zip Region Customer Ship To Zip Sectional Center Customer Bill To Name Customer Bill To Address Attributes Customer Credit Rating Customer URL ...