Monday, January 19, 2026

20JAN26 - Enterprise Data Model (EDM) Steps

 

Enterprise Data Model (EDM) Steps

  Enterprise Data Model (EDM) steps to create a data warehouse for northwind database with 5 different reports with granule and granularity  

Data Warehouse Design for Northwind

(With Granule & Granularity)


1. Define Business Objective

Goal
Provide consistent enterprise-wide reporting for:

  • Sales

  • Products

  • Customers

  • Employees

  • Logistics

EDM Focus
Single version of truth across all reports.


2. Identify Business Processes

(Kimball + EDM aligned)

ProcessDescription
Order ProcessingCustomer orders and order lines
Sales AnalysisRevenue & quantity
Product AnalysisProduct & category trends
Customer AnalysisBuying behavior
Shipping AnalysisDelivery performance

3. Define Enterprise Data Domains (EDM)

DomainEntities
SalesOrders, Order Details
CustomerCustomers
ProductProducts, Categories, Suppliers
EmployeeEmployees
TimeDate
LogisticsShippers

4. Conceptual Enterprise Data Model (High-Level)

Core Entities

  • Customer

  • Order

  • Order Line

  • Product

  • Employee

  • Shipper

  • Date

Key Relationships

  • Customer → Order (1:M)

  • Order → Order Line (1:M)

  • Product → Order Line (1:M)

At EDM level, no granularity yet—only business meaning.


5. Identify the Fact & Define the Granule (MOST IMPORTANT STEP)

🎯 Fact Table: FactSales

🔹 Granule (Grain)

One record per product per order per day

This means:

  • Each row = 1 product line item in an order

  • Lowest level of detail available from source

🔹 Granularity

  • Daily

  • Order Line level

  • Transactional

✔ Supports all summary and detailed reports
✔ Prevents double counting


6. Logical EDM → Dimensional Model

Fact Table

FactSales

AttributeDescription
OrderIDDegenerate dimension
DateKeyOrder date
CustomerKeyFK
ProductKeyFK
EmployeeKeyFK
ShipperKeyFK
QuantityUnits sold
UnitPricePrice
DiscountDiscount
SalesAmountCalculated

Dimension Tables (Granularity Alignment)

DimensionGrain
DimCustomerOne row per customer
DimProductOne row per product
DimEmployeeOne row per employee
DimDateOne row per day
DimShipperOne row per shipper

7. Granule vs Granularity (Clear Distinction)

TermMeaningExample
GranuleWhat one row representsOne product in one order
GranularityLevel of detailDaily, transactional

8. Reports with Granule & Granularity Mapping


📊 Report 1: Executive Sales Summary

Required Granularity

  • Monthly / Yearly

Derived From Granule

  • Aggregated from order-line daily grain

KPIs

  • Total Revenue

  • Total Orders

  • Average Order Value

✔ Safe aggregation because base grain is atomic


📊 Report 2: Product Performance Report

Granularity

  • Product × Month

KPIs

  • Revenue per Product

  • Units Sold

  • Category Contribution %

Uses

  • DimProduct

  • FactSales


📊 Report 3: Customer Analysis Report

Granularity

  • Customer × Quarter

KPIs

  • Customer Lifetime Value

  • Avg Purchase Frequency

  • Repeat Purchase Rate

Grain Dependency

  • Needs order-line detail to avoid duplication


📊 Report 4: Employee Sales Performance

Granularity

  • Employee × Month

KPIs

  • Revenue per Employee

  • Orders Handled

  • Avg Discount %

Grain Rule

Employee linked at order level, rolled up from line items.


📊 Report 5: Shipping & Logistics Report

Granularity

  • Shipper × Month

KPIs

  • Avg Shipping Days

  • On-Time Delivery %

  • Orders Shipped

Grain

  • Calculated using order-line facts + order dates


9. Why Lowest Granularity Wins (EDM Rule)

BenefitExplanation
FlexibilitySupports future reports
AccuracyNo aggregation loss
PerformanceCan pre-aggregate later
GovernanceSingle business definition

10. EDM Traceability Matrix

EDM EntityDW ObjectGrain
OrderFactSalesOrder Line
ProductDimProductProduct
CustomerDimCustomerCustomer
EmployeeDimEmployeeEmployee
ShipperDimShipperShipper

11. Final EDM-Driven Architecture

Northwind OLTP
     ↓
 Staging (Raw Data)
     ↓
 Enterprise Data Warehouse
     ↓
 Star Schema (FactSales)
     ↓
 Aggregates / Data Marts
     ↓
 Reports & KPIs

Key Exam / Interview Takeaway

Always define the grain before building the fact table.
Granule = what one row means
Granularity = level of detail

No comments:

Post a Comment

29jan26 - Physical model without a Logical one?

  Can you create a Physical model without a Logical one? The short answer: Yes. Technically, you can jump straight into a Physical Data Mod...