Video summary

🎯 ETL Part 01 - Designing a FACT Table

Main summary

Key takeaways

Educational

Summary

The video explains how to design a data-warehouse fact table from a complex operational source file. ETL work can be challenging because source systems may use difficult-to-control formats and data may come from text files, relational databases, NoSQL databases, or web services.

1. Understand the source data

The example uses an order file based on the AdventureWorks sample data. A single file can contain several record types:

  • H — Header: Order number, order date, customer, employee, and order-expiration date.
  • D — Detail: Product, quantity, unit price, and discount percentage. An order can have multiple detail lines.
  • T — Additional order details: Currency, promotion, location, and organization.

Production files may contain thousands of orders, so the design must account for both the source structure and the volume of data.

2. Identify the business event and fact-table grain

Begin by identifying the event being measured: order creation. Because an order can contain multiple product detail lines, the fact table should represent the measurable order data at the appropriate detail level.

The presenter emphasizes designing for broader analytical needs rather than simply copying the source-file layout.

3. Define the measures

The source provides three measures:

  • Quantity
  • Unit price
  • Discount percentage

The design adds three derived measures so analysts do not need to calculate them themselves:

  • Gross amount = quantity × unit price
  • Discount amount = gross amount × discount percentage ÷ 100
  • Net amount = gross amount − discount amount

This results in six measures. The general lesson is to store commonly used business measures in the warehouse when appropriate, making them easier for end users to analyze.

4. Identify the dimensions

The example uses eight dimensions:

  1. Customer
  2. Employee
  3. Product
  4. Currency
  5. Promotion
  6. Geography or location
  7. Organization
  8. Date

Dimensions should support the business’s analytical needs rather than being chosen solely by copying fields from the source.

Handling multiple dates

The order has both an order date and an expiration date. Both can reference the same date dimension in different roles, a pattern known as a role-playing dimension. If the analytics tools do not support this arrangement, separate date dimensions can be used.

5. Use warehouse surrogate keys

The fact table should link to dimensions through surrogate keys rather than relying on source-system codes. Integer surrogate keys can make joins more efficient than string identifiers, particularly in large warehouse tables.

The date dimension is a special case: its key is commonly represented in YYYYMMDD format, which can also support partitioning practices. The video points to separate resources for more information on surrogate keys, date dimensions, and partitioning.

6. Account for changing dimension data

The employee dimension is described as a Type 2 Slowly Changing Dimension (SCD), which preserves historical versions of employee records. When the current employee record is needed, the ETL process should select the record marked as current.

7. Assemble the fact-table design

The proposed fact table includes:

  • The six measures: quantity, unit price, discount percentage, gross amount, discount amount, and net amount.
  • Foreign keys for customer, employee, product, currency, promotion, geography or location, and organization.
  • Two date references: order date and order-expiration date.
  • Audit or tracking fields, such as the order number and record-inserted date.

The example assumes the dimensions have already been updated before the fact table is loaded. The next ETL stage is to translate the source records into this fact-table structure.

Speakers and sources featured

  • Speaker: The video presenter, who explains the ETL scenario and fact-table design.
  • Example data source: An AdventureWorks-style order text file and the AdventureWorks DW 2022 warehouse, including its dimension tables.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video