pbPassingBI
/
Reshaping & aggregating intermediate 5 min

Aggregate steps

Changing the grain of the data, and using it to prevent fan-outs.

What you'll be able to do
  • Aggregate to a coarser grain
  • Choose aggregations
  • Use an aggregate step before a join

How it works

An aggregate step has two panels: Grouped Fields on the left and Aggregated Fields on the right.

Drag the fields defining the grain into Grouped, and the measures into Aggregated, choosing sum, average, median, count, count distinct, min, max.

That is GROUP BY — grouped fields are the GROUP BY clause, aggregated fields are the aggregates.

Changing the grain

The output has one row per unique combination of grouped fields. Row-level detail is gone.

So aggregate late, once you no longer need the detail. Aggregating early and then discovering you need a row-level field means rebuilding the flow.

Preventing a fan-out

The most important use

Before joining a one-to-many relationship, put an aggregate step on the many side, grouped by the join key.

Order lines aggregated to one row per order can then be joined to orders without multiplying anything.

Same pattern as pre-aggregating a subquery in SQL, groupby before merge in pandas, or Summarize before Join in Alteryx.

Aggregate versus FIXED LOD

An aggregate step changes the grain — the detail rows are gone.

A {FIXED [Customer ID] : SUM([Revenue])} calculation keeps every row and attaches the group total to each one.

So: aggregate step when you want a summary table, FIXED when you want each row to carry its group's total. The same distinction as GROUP BY versus a window function.

Key points
  • Grouped fields define the grain; aggregated fields are the measures
  • Aggregate on the many side before joining to prevent a fan-out
  • An aggregate step changes the grain; a FIXED LOD keeps every row
Check yourself