DT6: Dimensional modelling

Lesson 3 of 5 · reading 15–25 minutes; practice and project time is on the module page

Measures that add up (and those that don't)

🎯You'll be able to

Tell additive, semi-additive and non-additive measures apart, and store and calculate each so totals stay correct.

🏠The everyday picture

You can add up a week's sales to get the week's total. You can't add up each day's closing bank balance to get the week's balance, or add the day's average prices to get anything at all.

📘What it really is

📝A worked example

Input: two ways to get October's average order value from mart_daily_sales: select avg(avg_order_value_paise) and select sum(net_revenue_paise) / sum(delivered_orders). Then compare customers: select count(distinct customer_key) from marts.fct_order_lines where status = 'delivered' with select sum(active_customers) from marts.mart_area_customers.

Expected output: the average of daily store averages is ₹672.98; the true figure is ₹673.67. Distinct customers are 598, but the area counts add up to 630, because customers who moved during the month are counted in both areas. Small gaps here; at real scale, such gaps reach board reports.

🌍Where it's used

📝Case scenario

A chain of coaching centres reported its average pass rate as the average of each centre's rate: 82%. Two tiny centres had 100% with a handful of students each, while the largest centre had 68%. Students passed divided by students sitting gave 74%.

🖱️Try it

Compute net revenue per delivered order for each store from mart_daily_sales, the right way. Then average the three results and compare with the month's overall figure. Success: you can explain why the average of the three isn't ₹673.67.

⚠️Common mistakes

🛠️For your project

Project 3 test 2 checks the dashboard's average order value is ₹673.67 (67,367 paise), computed from the summed parts.

✅Quick check

Is average order value additive?

Show the answer

No: store revenue and orders, and divide for the group shown.

Why don't customers per area add up to all customers?

Show the answer

Some customers appear in more than one area.

← PreviousStar schemas and shared dimensions
ProLearners Assist