11 Chapter11+ +Building+the+Data+Warehouse+ +part2
11 Chapter11+ +Building+the+Data+Warehouse+ +part2
4 Review
Review of the Data in the Data Warehouse
MODULE 11
SECTION 1
Dimensions
Dimensions
Overview of Dimensions
Dimensions provide descriptive context for the quantitative data in the
fact table in a data warehouse.
Denormalized
• Dimensions are denormalized tables
Descriptive Hierarchical
• Provide descriptive information about the business • Attributes in a dimension organized hierarchically for
analytics
• Use surrogate keys to join and describe data in the fact table
• Use hierarchies to aggregate or drill-down quantitative data
in the fact table
• Allows for slicing the quantitative data over different dimensions
• Time dimension provides historical context for the data in the fact
table
Dimensions
Overview of Slowly Changing Dimensions
Dimensions connected to a fact table are also affected by the passage of
time
• Data cannot be changed • Data can be changed • Create new record by tuple versioning
• No history preservation • Overwrite old data with new data • Historical record is made inactive
Key ID Name City Key ID Name City Key ID Name City From To Active
OLD
S123 123 Mike Rome S123 123 Mike Rome S123 123 Mike Rome Jan 1 - Yes
2022
Key ID Name City Key ID Name City Key ID Name City From To Active
NEW
S123 123 Mike Rome S123 123 Mike Milan S123 123 Mike Rome Jan 1 Dec 31 No
2022 2022
Type 1
FACT • Dim Date • Changes to these
Sales • Dim Currency
dimensions are rare but
updates are possible
Type 2
• Dim Product • Changes and history are
Dim Product
required
Important to define the type of dimension as part of the data warehouse design
Dimensions
Building the SCD Type 1 Dimensions
1 123 Nebbiolo 2015 95 1/1/2022 - Yes change, since it is the year of the
wine
Assignment
Build all Type 1 dimensions using Stored Procedures and invoke
them from ADF
Build one of the Type 1 dimensions using Mapping Data Flows
Fact Table
Dim Column Name
Dim Date
Store
key StoreId
SalesQty
Derive fact measures by applying
SalesAmount
Dim the appropriate calculations
Product CostAmount
MarginAmount
Facts
Building the Fact Table
• Calculate or derive required measures • Load merged data into the fact table
We learnt about different types of slowly We learnt about the concept of loading a Fact We then built the Fact table
table and the different ways to handle delta loads
changing dimensions We then reviewed our data warehouse with
various queries to analyze the data
References
Surrogate Keys
Surrogate Keys | James Serra's Blog