Multi-source Fan-in Patterns with dbt
📖 Scenario: You work as a data analyst at a retail company. You have sales data coming from two different sources: online_sales and store_sales. Your goal is to combine these two sources into a single table that shows total sales per product.
🎯 Goal: Build a dbt model that uses multi-source fan-in patterns to combine online_sales and store_sales tables into one table showing total sales per product.
📋 What You'll Learn
Create source definitions for
online_sales and store_salesCreate a staging model for each source
Create a final model that combines both staging models using UNION ALL
Aggregate total sales per product in the final model
💡 Why This Matters
🌍 Real World
Retail companies often have sales data from multiple channels. Combining these sources helps get a complete view of product performance.
💼 Career
Data analysts and engineers use multi-source fan-in patterns in dbt to build clean, combined datasets for reporting and analysis.
Progress0 / 4 steps