Let’s Get Certified
Module 11 / 18 · Data operations and support

Choose the grain before aggregating

A daily active-user dashboard joins sessions to purchases.

Choose the grain before aggregating

A daily active-user dashboard joins sessions to purchases. Define whether one row represents a person, a session or an order. Aggregate each input to the intended grain before a many-to-many join. For rolling metrics spell out the time window and how missing dates are represented. Compare a sampled calculation with a small hand-worked example.

Decisions to rehearse

Preaggregate before the join
Aligning both inputs to the target grain prevents multiple matches from inflating sums.
Windowed moving average
A window can retain each day while computing a mean across neighboring days.
Conditional aggregation or pivot
Grouping by a key and placing categories in columns produces a comparative cross-tab.
QuickSight dashboard
A published dashboard presents repeatable interactive views over an approved dataset.

Practise each AWS skill

These references use the skill numbers in the AWS guide.

  1. 3.2.1 · Publish a view of approved metrics in QuickSight and verify the dashboard against a known source total.
  2. 3.2.2 · Inspect invalid dates and duplicate business keys with a notebook or SQL before imputing or removing records.
  3. 3.2.3 · Write a grouped Athena or Redshift view and reconcile one group's result with its source rows.
  4. 3.2.4 · Use an Athena Spark notebook for exploratory profiling and identify which findings must move into repeatable code.
  5. 3.2.5 · Compare cost and latency of serverless and provisioned execution for a sporadic investigation and a steady dashboard.
  6. 3.2.6 · Hand-calculate a rolling mean, a grouped sum and a pivot for the same tiny dataset to verify their grains.

Official skills for this topic

Work through the decision

A store with two sales lines and three tender payments produces six joined records. Which check proves a redesigned dashboard preserves both measures?

Check your reasoning

Aggregate each side to the order key first, reconcile each independent subtotal against its source and then join the single rows. Validate at both order and store-day grain.

DEA-C01 recording · 2:13:31

Related lesson in Data Engineer Associate · SQL commands and logic.

Knowledge check

Choose the grain before aggregating quiz

Answer 3 questions. Check each answer for an explanation.