How to group a CSV
- Open a CSV file and tick the columns to group by. Ticking two gives one row per combination, such as region and month.
- Add aggregates: pick a column and a function for each. The row count is there to start with.
- Sort by a key or by any aggregate, then copy the summary or download it as CSV.
Dates can be bucketed into days, weeks, months, quarters or years before grouping, which turns a transaction log into a monthly summary in one step. To see the result as a chart, open the same file in the chart maker.
Frequently asked questions
What is the difference from the pivot table?
Group by gives one row per group with as many aggregate columns as you like, which is what you want for a summary to paste or chart. The pivot table spreads one aggregate across a grid of rows and columns.
Which aggregates are available?
Row count, count of non-empty values, distinct count, sum, average, minimum, maximum and median. Sum, average and median need a number column; minimum and maximum also work on dates.
How are empty values grouped?
Rows with an empty key are collected in a (blank) group, so no row is silently dropped.
Is it like SQL GROUP BY?
Yes, it gives the same result as SELECT keys, COUNT(*), SUM(…) … GROUP BY keys. For anything more complex, use the SQL query tool.