Dimensional Modeling
Dimensional Modeling
Dimensional Modeling
PurchaseOrderDetail
Employee (HumanRe
Store (Sales) s
Person (Person)
SalesReason
Vendor (Purchasing)
(Sales)
SalesOrderHeader (S
Customer (Sales)
SalesOrderHeaderSa
l
SalesTerritory (Sales
SalesOrderDetail (Sa
Dimensional Model/Star Schema
DimPromotion
DimProduct DimEmployee
FactResellerSales
DimTime DimReseller
The Four Steps
Common dimensions
Product
Item
Date
Enterprise Business Architecture
Dimensions
High Level Dimensional Model
Sales Reason Promotion Order Date
Start Date
Reason Type Discount Yea
Reason Percent r Month
C Day
ategory Is Weekend
State
Sales Is Weekend Day Month Year
Is Weekend
Product Name Day
Colour Month
Category Year
SKU Gender
City
Product Full Name Delivery Date
Customer ID
Customer
Attribute Keys and Names
Country
State Marital
State
Customer Customer Customer
Customer
Attributes Hierarchies
Slowly Changing Dimensions
Change happens!
Attributes of a dimension that would undergo
changes over time. It depends on the business
requirement whether particular attribute history of
changes should be preserved in the data warehouse.
This is called a slowly changing attribute and a
dimension containing such an attribute is called a
slowly changing dimension.
Type I: Overwrite the attribute
1 £200
1 £150
Cust Key Cust ID Full Name Marital City Country Valid From Valid To
Cust Key Cust ID Full Name Marital City Country Valid From Valid To
Cust Key Cust ID Full Name Marital City Country Valid From Valid To
2 £200
3 £150
Type III: Add a new attribute
Cust Key Cust ID Full Name Marital City Country Previous Country
Cust Key Cust ID Full Name Marital City Country Previous Country
1 £200
1 £150
Date and Time
State
Employee
Employee Location
Degenerate Dimensions
Numeric
Additive
Yes you can
have strings
Yes you can
have non-
Fact-less Facts
State
Sales Is Weekend Day Month Year
Is Weekend
Product Name Day
Colour Month
Category Year
SKU Gender
City
Product Full Name Delivery Date
Customer ID
Customer
Sample: Exercise High Level Dimensional Model
Telecom Company
Bank
Bahria University
DW Tips: 10 Essential Dim Mod
Rules
Store report lables and Load detailed atomic data into
filter domain values in dimensional structures
dimension tables
Structure dimensional models
Dimension tables should around business processes
use
Ensure every fact table has a
surrogate keys
date dimension table
Create conformed
Ensure all facts in a Fact table
dimensions to integrate
are the same grain
data across the enterprise
Resolve many-to-many
Continuously balance
relationships in fact tables
requirements and realities to
deliver a DW/BI solution Resolve many to one
that’s accepted by business relationships in dimension
users and that supports tables
their decision making
DW Tips: Dimensional Modeling