Guide · FinOps & MIS Automation

Automate Financial Reporting with SQL

A field-tested approach to replacing manual close-of-month spreadsheets with repeatable, audit-ready reporting pipelines using Excel, SQL, and a thin BI layer.

By Kashika Katyal · Senior Data Analyst · 8 min read

Why automate financial reporting?

Most finance teams still rebuild the same monthly MIS pack by hand: pull extracts from the ERP, paste into a template, refresh pivots, fix broken references, email the deck. It burns three to five days every cycle and quietly hides reconciliation errors that surface only at audit.

Automation isn't about replacing the analyst — it's about removing the mechanical work so the analyst can spend the cycle on variance commentary, forecasting, and partnering with the business.

The four-layer reporting pipeline

Every reliable reporting workflow has the same four layers:

  1. Source — raw transactional data (ERP, billing, payroll, CRM).
  2. Stage — cleaned, typed, deduplicated tables in SQL.
  3. Model — business logic: GL mappings, cost centres, FX, accruals.
  4. Present — Excel pack, BI dashboard, or scheduled email.

Keep these layers strictly separated. The most common failure mode is putting business logic inside the Excel presentation layer — it makes the numbers impossible to audit and impossible to reproduce next month.

Step 1 — Stage your data with SQL

Land the raw extracts in a staging schema, one table per source. Resist the urge to join or aggregate at this stage; staging should be a faithful, queryable copy of the source.

-- stage/invoices.sql
CREATE OR REPLACE TABLE stage.invoices AS
SELECT
  invoice_id,
  customer_id,
  CAST(invoice_date AS DATE)        AS invoice_date,
  CAST(amount AS NUMERIC(18,2))     AS amount_local,
  UPPER(currency)                   AS currency,
  status
FROM raw.erp_invoices
WHERE invoice_date >= DATE '2023-01-01';

Step 2 — Model business logic once

Build a thin modelling layer where every calculation lives exactly once: FX conversion, GL account mapping, cost-centre allocations, accrual rules. When the CFO asks "why did revenue move?", you can point to a single view, not a chain of VLOOKUPs.

CREATE OR REPLACE VIEW model.revenue_monthly AS
SELECT
  DATE_TRUNC('month', i.invoice_date) AS period,
  m.region,
  m.product_line,
  SUM(i.amount_local * fx.rate_to_usd) AS revenue_usd
FROM stage.invoices i
JOIN dim.customer m  ON m.customer_id = i.customer_id
JOIN dim.fx_rate fx  ON fx.currency = i.currency
                    AND fx.month = DATE_TRUNC('month', i.invoice_date)
WHERE i.status = 'POSTED'
GROUP BY 1, 2, 3;

Step 3 — Let Excel be the presentation layer

Excel is still where finance teams live, and that's fine. Connect it to your SQL model with Power Query, drop a pivot on the modelled view, and refresh on open. Variance commentary, formatting, and the executive summary stay in Excel; numbers come from one source of truth.

The rules that keep this maintainable:

  • No SUMIFS against raw extracts inside the pack.
  • One named query per modelled view, refreshed on file open.
  • Every figure traceable to the SQL view it came from.
  • Lock the structure — never paste-special over a connected cell.

Step 4 — Schedule, alert, and version

A pipeline you have to remember to run isn't automation. Wire the refresh to a scheduler (Airflow, dbt Cloud, GitHub Actions, or even Windows Task Scheduler if that's what the org allows), version every SQL file in Git, and add a basic reconciliation check that emails the controller when totals drift more than a configured threshold.

What changes for the team

In every team I've rebuilt this for — at Warner Bros. Discovery, S Chand, AuthBridge, and Accenture — close time dropped by 40-70%, reconciliation errors became visible instead of hidden, and analysts moved from spreadsheet janitors to partners the business actually asked questions of. That's the real win: not the automation, but what the team does with the time it gives back.

Need help automating your MIS?

I help finance and FinOps teams design reporting pipelines they can trust.

Get in touch →