14. High Level Dimensional Model
Promotion
Sales Reason Order Date
Start Date
Reason Type Discount Percent Year
Reason Category Month
Day
Is Weekend
Internet
Sales Territory Ship Date
Country State
Sales Is Weekend Day Month Year
Is Weekend
Product Name Day
Colour Month
Category Year
Gender
SKU
City
Product Delivery Date
Full Name
Customer ID
Customer
15. Attribute Keys and Names
All attributes have both a key and a name
Keys must be unique
Cust ID Full Name Marital City Country
MJ0001 Mary Jones S London UK
Attribute Key Name
Customer ID Cust ID Cust ID
Full Name Cust ID Full Name
Marital Status Marital Marital
City City City
Country Country Country
16. Attribute Relations
and Hierarchies
Country
Country
State Marital
City Gender Gender
State
Customer Customer Customer
Age
Gender Marital
City Customer State Gender
City Country Marital
Customer
Attributes Hierarchies
18. Type I: Overwrite the attribute
Cust Key Cust ID Full Name Marital City Country
1 MJ0001 Mary Jones S London UK
Cust Key Sales Amount
1 £400
19. Type I: Overwrite the attribute
Cust Key Cust ID Full Name Marital City Country
1 MJ0001 Mary Smith M London UK
Cust Key Sales Amount
1 £400
20. Type I: Overwrite the attribute
Cust Key Cust ID Full Name Marital City Country
1 MJ0001 Mary Smith M London UK
Cust Key Sales Amount
1 £400
1 £200
1 £150
21. Type II: Add a new dimension row
Cust Key Cust ID Full Name Marital City Country Valid From Valid To
1 MJ0001 Mary Jones S London UK 14/12/2000 NULL
Cust Key Sales Amount
1 £400
22. Type II: Add a new dimension row
Cust Key Cust ID Full Name Marital City Country Valid From Valid To
1 MJ0001 Mary Jones S London UK 14/12/2000 01/02/2009
2 MJ0001 Mary Jones S Leeds UK 01/02/2009 NULL
Cust Key Sales Amount
1 £400
23. Type II: Add a new dimension row
Cust Key Cust ID Full Name Marital City Country Valid From Valid To
1 MJ0001 Mary Jones S London UK 14/12/2000 01/02/2009
2 MJ0001 Mary Jones S Leeds UK 01/02/2009 NULL
Cust Key Sales Amount
1 £400
2 £200
2 £150
24. Type III: Add a new attribute
Cust Key Cust ID Full Name Marital City Country
1 MJ0001 Mary Jones S London UK
Cust Key Sales Amount
1 £400
25. Type III: Add a new attribute
Cust Key Cust ID Full Name Marital City Country Previous Country
1 MJ0001 Mary Jones S London USA UK
Cust Key Sales Amount
1 £400
26. Type III: Add a new attribute
Cust Key Cust ID Full Name Marital City Country Previous Country
1 MJ0001 Mary Jones S London USA UK
Cust Key Sales Amount
1 £400
1 £200
1 £150
27. Date and Time
Create your own date dimension
Attribute keys must be unique
“January” vs. “January 2009”
Time of day – do you really need it?
Time zones – do you really need them?
Pre-calculate durations into fact rows
Use calculated surrogate dimension keys
E.g. Key = 10000 x year + 100 x month + day
29. Parent-Child Dimensions
How do you model composite
or hierarchical structures?
E.g. Bill of Materials or
Employee/Manager
30. Mini-Dimensions
How do you manage high frequency, low
cardinality change in a dimension?
Country
State
Age
Gender Marital Current Location
City
Employee
Employee Location
31. Degenerate Dimensions
How do you deal with the high
cardinality dimensions like
“transaction number”?
32. Junk Dimensions
How do you deal with the low
cardinality, non-related
dimensions like gender or
other booleans?
37. Currency and Units of Measure
How do you enable currency conversions?
How do you represent amounts in different
units?
e.g. 400 bikes == 2 pallets == 10 shipping crates
Put the conversion factors in the fact table
Expose the calculated results in the cube
OR
Use a separate conversion measure group
See Exchange Rates in AdventureWorks
38. The Four Steps
Choose the Business Process
Declare the Grain
Identify the Dimensions
Identify the Facts