Presentation on theme: "MIS 451 Building Business Intelligence Systems Logical Design (4)"— Presentation transcript:
MIS 451 Building Business Intelligence Systems Logical Design (4)
3 D4: Conformed Dimension A conformed dimension table is a dimension table shared by fact tables. Ex: PRODUCT dimension table is shared by two fact tables – SALESFACT and PROCOST. A conformed dimension table should mean the same thing with every fact table to which it is joined. D: refers to special considerations for dimension tables or special types of dimension tables
4 D4: Conformed Dimension Conformed dimension tables connect separate star schemas into an enterprise star schema. Support drill across queries on star schema
5 D5: Role-playing Dimension Role-playing dimension is a dimension which plays several simultaneous roles when used with a fact table. In the following star schema, time dimension plays two different roles – ORDERDATE and DELIVERYDATE.
6 D5: Role-playing Dimension Although ORDERDATE and DELIVERYDATE have exactly the same table structure, they need to be treated as different tables. SALEFACT (CUSTOMER_KEY, PRODUCT_KEY, ORDERDATE_KEY, DELIVERYDATE_KEY, QUANTITY, SALES) ORDERDATE (ORDERDATE_KEY, ODATE, DAY_OF_WEEK, DAY_OF_MONTH) DELIVERYDATE (DELIVERYDATE_KEY, DDATE, DAY_OF_WEEK, DAY_OF_MONTH) Query: List sales of products ordered on Wednesday and delivered on Friday Select sum(sales) From SALEFACT S, ORDERDATE O, DELIVERYDATE D Where S.ORDERDATE_KEY = O. ORDERDATE_KEY AND S. DELIVERYDATE_KEY = D. DELIVERYDATE_KEY AND O.DAY_OF_WEEK = 3 AND D.DAY_OF_WEEK = 5
7 D5: Role-playing Dimension If we replace ORDERDATE and DELIVERYDATE with one time dimension table SDATE, we get, SALEFACT (CUSTOMER_KEY, PRODUCT_KEY, ORDERDATE_KEY, DELIVERYDATE_KEY, QUANTITY, SALES) SDATE (SDATEID, SDATE, DAY_OF_WEEK, DAY_OF_MONTH) Note: ORDERDATE_KEY and DELIVERYDATE_KEY in SALEFACT table are foreign keys refer to SDATEID in SDATE table. Query: List total sales ordered on Wednesday and delivered on Friday Select sum(sales) From SALEFACT S, SDATE SD Where S.ORDERDATE_KEY = SD.SDATEID AND S.DELIVERYDATE_KEY = SD.SDATEID AND SD.DAY_OF_WEEK = 3 AND SD.DAY_OF_WEEK = 5 This query will return nothing!
8 F2: Types of Fact Attributes Additive fact attributes can be added along any dimension.
9 F2: Types of Fact Attributes Non-additive fact attributes cannot be added along any dimension.
10 F2: Types of Fact Attributes Semi-additive fact attributes can be added along some dimensions.
11 F3: Factless Fact Table Factless fact table is a fact table that contains only warehouse keys without any fact attributes. Factless fact table is useful for event tracking, such as tracking student class attendance event.
12 F3: Factless Fact Table
13 F3: Factless Fact Table Instead of sum function used in common fact tables, query on factless fact tables use count function How may courses did student Mark take on 01/01/99? Select count(course_key) From Attendance A, Attend_time AT, Student S, Course C Where A.Time_key = AT.Time_key AND S.Student_key = A.Student_key AND S.SNAME = ‘Mark’ AND AT.Date = ’01/01/99’