Sumwise
Live demo · no signup

How do I pivot expenses by department from a GL export?

The GL pivot ritual: filter out the revenue accounts, insert a PivotTable, drag departments to columns and accounts to rows, fix the refresh that swallowed two cost centers, format, repeat next month-end. The trap is always the same first step — the revenue rows that inflate "total spend" when someone forgets the filter. The demo below runs the pivot on a sample GL export with the expense filter encoded in the SQL, not in someone's memory.

sumwise · live demo · no signup

The gl_expenses.csv sample (period…) is registered as a DuckDB table in your browser — the exact engine workspaces use. SQL is always shown.

The SQL and the result table appear here — press Run.

Running on the sample gl_expenses.csv — the question is editable, and the Your own CSV tab registers your file in your browser instead.

Sample datagl_expenses.csv

How to pivot expenses by department from a GL export — without the manual grind

01

The filter people forget, encoded once

The sample GL carries an account_type column; the generated SQL filters to expense-type accounts before the pivot, so revenue can never leak into spend. Expense/Opex/COGS naming variants are detected from your data.

02

A real pivot, not a screenshot

Accounts as rows, one column per department, total spend per account, biggest first — the conditional-aggregation SQL is shown and editable, so the pivot adapts to your chart of accounts instead of the other way around.

03

Same pivot next month, one click

In a workspace the query saves as a re-runnable artifact with a share link. New export, same question, regenerated table — the month-end pivot stops being a rebuild.

Common questions

How are revenue accounts excluded?

If your GL export has an account_type (or type/class) column, the SQL filters to the expense-like values it detects — Expense, Opex, COGS all qualify. No type column? The template pivots every account and says so in its note.

What column names does it understand?

Common GL variants: account/account_name/line_item, department/dept/cost_center, account_code, amount/value/balance. The matcher handles the synonyms so you don't rename columns before asking.

Can I keep the table for the board pack?

Yes — copy the table, or save the query as an artifact in a free workspace and re-run it on each month's export. SQL, table and share link stay together.

Run this on your own export, every month

Free workspace: 10 questions/day, files up to 10 MB. Pro $15/mo ($99/yr) for 100 MB. Your files never leave your browser.

client-side by design SQL always shown

More live demos