Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 ACCTG 6910 Building Enterprise & Business Intelligence Systems (e.bis) Dimensional Modeling VI Olivia R. Liu Sheng, Ph.D. Emma Eccles Jones Presidential.

Similar presentations


Presentation on theme: "1 ACCTG 6910 Building Enterprise & Business Intelligence Systems (e.bis) Dimensional Modeling VI Olivia R. Liu Sheng, Ph.D. Emma Eccles Jones Presidential."— Presentation transcript:

1 1 ACCTG 6910 Building Enterprise & Business Intelligence Systems (e.bis) Dimensional Modeling VI Olivia R. Liu Sheng, Ph.D. Emma Eccles Jones Presidential Chair of Business

2 2 Outline Factless Facts (Ch. 2, 12, 15) Snapshot Facts (Ch. 3) Slowly Changing Dimensions (Ch. 4) M-to-M Relationships – Multi-valued Dimensions (Ch. 9, 13)

3 3 FacultyStudent Course (Ternary) Relationship: One or many students take one or many courses from one teacher Measure: # of times the whole or a partial relationship occurs 1m m Factless Facts: Measuring Occurrences of Relationships or Events

4 4 Enrollment Fact Faculty Key Student Key Course Key Time Key Student Dimension Course Dimension Time Dimension Faculty Dimension Factless Facts No attributes other than the DW keys of dimension tables are in the fact table

5 5 FacultySemester Course 1m m Classroom 1 Factless Facts Relationship: a teacher teaches in a classroom 1 or many courses over one or many semesters Measure: # of times the whole or a partial relationship occurs

6 6 Room Assignment Fact Room Key Faculty Key Course Key Time Key Room Dimension Course Dimension Time Dimension Faculty Dimension Factless Facts

7 7 Snapshot Facts: The Simplest Inventory Schema Time Dimension time_key product_key warehouse_key quantity_on_hand Warehouse Dimension Product Dimension Inventory Fact Accumulative measure

8 8 Slowly Changing Dimension

9 9 Values of attributes in dimension tables may evolve over time. For example, customers moved from one city to another city. CID CNameStateCity 101JonArizonaTucson 102TomArizonaTucson 103MarkArizonaPhoenix Tom moved from Tucson to Salt Lake City Salt Lake City Utah

10 10 Slowly Changing Dimension There are three ways to handle slowly changing dimension. Method 1: Overwrite old values with new values CID CNameStateCity 101JonArizonaTucson 102TomArizonaTucson 103MarkArizonaPhoenix CID CNameStateCity 101JonArizonaTucson 102TomUtahSalt Lake city 103MarkArizonaPhoenix

11 11 Slowly Changing Dimension Drawbacks of method 1: Historical information is totally lost. We will never know that customer 102 lived in Tucson before. Moreover, when listing sales by city, all the sales of customer 102 will be counted as part of Salt Lake City sales, although 102 was in Tucson before.

12 12 Slowly Changing Dimension Method 2: Add a new attribute to record current value of the changing attribute. CID CNameStateCity 101JonArizonaTucson 102TomArizonaTucson 103MarkArizonaPhoenix CIDCNameStateOriginal CityCurrent City 101JonArizonaTucson 102TomArizonaTucsonSalt Lake City 103MarkArizonaPhoenix Current State Arizona Utah

13 13 Slowly Changing Dimension Drawbacks of method 2: Only partial Historical information (original & current) is kept. Considering that customer 102 moved from Tucson to Phoenix then to Salt Lake City, the customer information of customer 102 only includes Tucson and Salt Lake City.

14 14 Slowly Changing Dimension Warehouse key Method 3: Add a new dimension record whenever change occurs  keep all the information. Utah Utah Salt Lake City

15 15 Multi-Value Dimension Most of the dimension tables have a 1-m relationship with the fact table Product  Sale, Customer  Sale, SalesDate  Sale… What if there is a m-to-m relationship between a dimension and a fact?

16 16 Multi-Value Dimension PatientDatePhysicianMedication 1Medication 2 112/11/00JamesAspirinTylenol 21/2/01KathyTylenolAlomide 12/1/01JamesAtivanLodine The above table is a visit table from a clinic. We want a factless fact table and preserve medication information

17 17 Multi-Value Dimension VISIT Time Patient Med. Physician m to m !! A physician may prescribe 1 or many medications at a patient visit A physician may prescribe the same medication at different visits

18 18 Multi-Value Dimension If we have a “grouping” table for medication…. PatientDatePhysicianGroupID 112/11/00James1 21/2/01Kathy2 12/1/01James3 GroupIDMedication 1Aspirin 1Tylenol 2 2Alomide 3Lodine 3Ativan

19 19 Medication Dimension Medication Group Bridge Medication Group GroupIDMedication 1Aspirin 1Tylenol 2 2Alomide 3Lodine 3Ativan GroupID 1 2 3 Medication Aspirin Tylenol Alomide Lodine Ativan 11 m m Medication Group Bridage is what we call a bridge table

20 20 Multi-Value Dimension Medication Medication Group Bridge Medication Group 1 1 m m VISIT Time PatientPhysician


Download ppt "1 ACCTG 6910 Building Enterprise & Business Intelligence Systems (e.bis) Dimensional Modeling VI Olivia R. Liu Sheng, Ph.D. Emma Eccles Jones Presidential."

Similar presentations


Ads by Google