Data aggregation combines many records into summary values for chosen grouping dimensions and time intervals. Grouping purchases by date, for example, produces one row per day with means, sums, and counts for measures such as quantity, unit cost, total cost, and purchase count. section 12.6.3
Aggregation makes irregular event records comparable across entities or periods. Purchases can be grouped by purchaser and hour or day, while sales and purchases can be resampled into daily time series; missing purchaser-period combinations may receive zero counts. section 17.1
Choose the grouping and summary carefully:
- Use enough observations within each group and enough groups for comparison; sparse summaries make findings less reliable. section 12.6.3
- Compare alternative dimensions such as date, day of month, day of week, or hour rather than assuming one grouping reveals every pattern. section 12.6.3
- Treat unusual aggregate values as investigation leads, not automatic anomalies; calendar composition can explain effects such as an unusually low 31st day. section 12.6.3
Daily purchase summaries
Grouping the purchases table by Date and aggregating Count, Unit Cost, and Total Cost with mean and sum, alongside Purchase ID with count, creates a daily comparison table. Plotting total purchases by day of month can reveal a notably high 28th day, which warrants follow-up rather than immediate classification as an outlier.


















