1. Inputs
We start by connecting to 4 distinct CSV files.
- Fact side:
order_details.csv(qty, pizza id) andorders.csv(date, time). - Dimension side:
pizzas.csv(price, size) andpizza_types.csv(name, category).
2. Join #1: Fact Table
Goal: Add date and time to order details.
We use a Join tool to match order_details and orders on order_id.
3. Join #2: Dimension Table
Goal: Merge pizza attributes.
Join pizza_types and pizzas on pizza_type_id. This acts as our primary lookup table.
4. Join #3: Master Pizza File
Goal: Combine Fact (sales events) with Dimension (pizza attributes).
Join the outputs of Join 1 and Join 2 together on pizza_id.
5. Formula: Calculate Pizza Sales
Add a Formula tool to calculate revenue line-by-line.
Pizza Sales = [quantity] * [price]
6. Data Format & Preparation (Summarize)
Branch the Master data into three Summarize tools to get different aggregation levels:
- Summarize A: Group by
nameandcategory. Sum Pizza Sales -> Total Sales per Pizza Type. - Summarize B: Group by
category. Sum Pizza Sales -> Total Sales per Category. - Summarize C: NO grouping. Sum Pizza Sales -> Total Sales (produces a 1-row table).
7. Combine Totals (Join & Append)
Bring the aggregations back together.
- Join: Connect Sum A and Sum B on
category. Now each pizza row knows its category total. - Append Fields: Connect the Join output (T) and Sum C (S). This attaches the single overall Total Sales value to every single row.
8. Final Formula: % Metrics
Use a final Formula tool to calculate the business requirements:
% of Total Sales= ([Total Sales per Pizza Type] / [Total Sales]) * 100% of Category Sales= ([Total Sales per Pizza Type] / [Total Sales per Category]) * 100
9. Desired Output
Connect an Output Data tool to write the final polished dataset to pizza_output.xlsx (Sheet1).