L01 / 7 labs Grain Under Pressure
0 / 20 complete
Rookie Analyst 0 XP
+100 XP Mission complete.
Practice Lab · 02 · Data Foundations

Grain Under Pressure

Join order-level revenue to item-level rows and watch a perfectly valid SUM become wrong.

GrainOne-to-many joinsReconciliation
Case brief

Preserve one row per order while still bringing item information into the analysis.

01
Your task

Break it. Run the checks. Explain the evidence.

01

Run the failure

Use the red CTA to create the analytical problem intentionally.

02

Predict the result

Before validating, decide what you expect row counts or metrics to do.

03

Run validation

Use the green CTA to reveal the checks that catch the failure.

04

Explain it

Say what broke in plain business language, not only SQL language.

02
Interactive case

Run this.

RUN THIS CASE ↓

Grain Under Pressure

Preserve one row per order while still bringing item information into the analysis.

8 min Warm-up 02 · Data Foundations
Ready — run the case. GMV jumps even though no new order happened.
ordersgrain: order
1001$25
1002$40
1003$45
SUM(gross_value)$110
JOIN items
joined result3 rows5 rows
1001 · item A$25
1001 · item B$25repeated
1002 · item C$40
1002 · item D$40repeated
1003 · item E$45
SUM(gross_value)$110$175
BaselineFailure visible

Order grain is stable.

Order value repeated at item grain.

Diagnosis: aggregate items separately or remove the order-level measure before summing. Then reconcile back to $110.

Debrief unlocked

What should the analyst learn?

  1. State the target grain before joining.
  2. Compare row count and distinct business keys.
  3. Aggregate lower-grain data before attaching order-level measures.
03
Transfer

Use the same checks at work.

01

State the target grain before joining.

02

Compare row count and distinct business keys.

03

Aggregate lower-grain data before attaching order-level measures.