Run the failure
Use the red CTA to create the analytical problem intentionally.
Join order-level revenue to item-level rows and watch a perfectly valid SUM become wrong.
Preserve one row per order while still bringing item information into the analysis.
Use the red CTA to create the analytical problem intentionally.
Before validating, decide what you expect row counts or metrics to do.
Use the green CTA to reveal the checks that catch the failure.
Say what broke in plain business language, not only SQL language.
Preserve one row per order while still bringing item information into the analysis.
1001$251002$401003$451001 · item A$251001 · item B$25repeated1002 · item C$401002 · item D$40repeated1003 · item E$45Diagnosis: aggregate items separately or remove the order-level measure before summing. Then reconcile back to $110.
State the target grain before joining.
Compare row count and distinct business keys.
Aggregate lower-grain data before attaching order-level measures.