← All posts
4 min read

Summarizing Sales Data by Region and Product Category

You have a CSV export of order data. Management wants a breakdown: total quantity sold and total revenue, grouped by region and product category. Cancelled orders should be excluded. The output needs to land in an Excel file.

This is a five-minute job in ExploreMyData. Here's the exact pipeline.

Step 1: Import the CSV

Drop your file onto the app. The CSV has these columns:

order_iddateregioncategoryquantityunit_pricestatus
10012026-03-01NorthElectronics3149.99completed
10022026-03-02SouthClothing539.99completed
10032026-03-03NorthHome1299.00cancelled
10042026-03-04WestElectronics289.50completed
10052026-03-05SouthElectronics4149.99completed

ExploreMyData auto-detects column types. quantity and unit_price will be recognized as numeric.

Step 2: Filter out cancelled orders

Add a Filter operation. Set the condition to status != 'cancelled'. This removes any rows where the order was cancelled before computing totals. In the example above, order 1003 drops out.

Step 3: Group & Aggregate

This is the core step. Add a Group & Aggregate operation with the following configuration:

  • Group by: region, category
  • Aggregates: SUM(quantity) and SUM(quantity * unit_price) as revenue

The revenue aggregate uses a calculated field: quantity * unit_price. If your data already has a revenue column, you can sum that directly instead.

The result is one row per region-category combination:

regioncategorysum_quantityrevenue
NorthElectronics3449.97
SouthClothing5199.95
SouthElectronics4599.96
WestElectronics2179.00

Group & Aggregate configuration

  • Group by columns: region, category
  • Aggregate 1: SUM(quantity) → sum_quantity
  • Aggregate 2: SUM(quantity * unit_price) → revenue

Generated SQL: SELECT region, category, SUM(quantity) AS sum_quantity, SUM(quantity * unit_price) AS revenue FROM data WHERE status != 'cancelled' GROUP BY region, category ORDER BY revenue DESC

Step 4: Export as Excel

Click the Export button and choose .xlsx. The summary table downloads as an Excel file, ready to attach to an email or drop into a shared drive.

Reusing this pipeline next month

The pipeline you just built (Filter, then Group & Aggregate) stays intact in the sidebar. When next month's data arrives, load the new CSV and the same steps apply automatically. Column names need to match, but the data can be any size. A file with 10 rows and a file with 500,000 rows run through the same pipeline with no changes.

If your report needs additional breakdowns (by month, by sales rep), add more columns to the Group By list. The Group & Aggregate guide covers all the available aggregate functions and configuration options.

Build your summary pipeline →

Try it yourself

No sign-up, no upload, no tracking.

Open ExploreMyData