Intermediate· 12 min

Build a Grouped Revenue Report

Build a complete workflow — filter, group, sort — against a PostgreSQL table, and verify the exact SQL it produces.

What you'll do

Build a workflow that filters accounts to active ones, totals revenue by region, sorts highest first, and shows you the compiled SQL.

Prerequisites

A saved PostgreSQL connection — see Connect PostgreSQL and Browse a Table if you don't have one yet.

Steps

1. Start a new workflow

Open the Visual Designer and drag an Input node onto the canvas.

2. Select your source

Click the Input node and choose your PostgreSQL connection, then the relevant table (e.g. accounts).

3. Add a Filter node

Connect a Filter node after Input. Set column to status, operator to =, value to active.

4. Add a Summarize node

Connect a Summarize node after Filter. Set the measure to SUM(revenue), and group by region.

5. Add a Sort node

Connect a Sort node after Summarize. Sort by revenue, descending.

6. Add a Browse node

Connect a Browse node to see the results.

7. Check the SQL tab

Open the SQL tab in the results panel. You should see something close to:

SELECT region, SUM(revenue) AS revenue
FROM accounts
WHERE status = $1
GROUP BY region
ORDER BY revenue DESC

8. Save the result

Replace the Browse node with an Output node to save this as a reusable dataset in Platform Storage.

Where this breaks down

This workflow works because it needs exactly one filter and one aggregation. Joining to a second table, or applying multiple filters, isn't supported yet — see the feature roadmap.

More tutorials