get_revenue_quarterly โ€” Quarterly Revenue

How much we invoiced per customer and salesperson, by quarter, from posted A/R invoices.

This is a Named SQL Query (SAP /SQLQueries) โ€” dynamic aggregate SQL returning per-query rows, not a fixed Service Layer entity.

Quarterly revenue report โ€” how much we invoiced per customer and salesperson, by quarter. Returns one row per quarter ร— customer ร— salesperson with the summed revenue, plus the year, quarter, and a YYYY-Qn period label (e.g. 2025-Q2), newest quarter first. Revenue is taken from posted A/R invoices.

Try these prompts

  • “show me quarterly revenue”
  • “how much did we invoice per quarter?”
  • “revenue by quarter”
  • “Q2 revenue for C001”
  • “which quarter dipped in 2025” ยท “how has revenue trended by quarter since 2023”

ื ืกื• ื’ื ื‘ืขื‘ืจื™ืช

  • “ื”ืฆื’ ื”ื›ื ืกื•ืช ืจื‘ืขื•ื ื™ื•ืช”
  • “ื›ืžื” ื—ื™ื™ื‘ื ื• ื‘ื›ืœ ืจื‘ืขื•ืŸ?”
  • “ื‘ืื™ื–ื” ืจื‘ืขื•ืŸ ื”ื™ื™ืชื” ื™ืจื™ื“ื”?”

Arguments

ArgRequiredMeaning
card_codeoptionalOne customer, e.g. C001. Omit for all customers.

Example result

Q2 beat Q1. 2025-Q2 โ€” C001 Acme Corp $31,000; C002 Beta Industries $18,500. 2025-Q1 โ€” C001 Acme Corp $24,200.

Result columns

ColumnTypeMeaning
yearnumberThe calendar year. Declared number because that is what the row holds (int32 in the query); it reads as a label, but the type states the DATA, not the axis role.
quarternumberThe calendar quarter, 1-4.
period_labeltextYear and quarter rendered for display, e.g. 2025-Q2.
customer_codetextThe invoiced customer’s SAP code.
customer_nametextThe invoiced customer’s name.
salesperson_codenumberThe salesperson credited with the invoices (0 when unassigned).
revenuenumberRevenue posted for that quarter ร— customer ร— salesperson.

Charts

None. This tool returns one row per period ร— customer ร— salesperson, so period_label repeats across rows and a line keyed on it would plot the same quarter many times. Aggregation belongs in the tool’s SQL, not the chart layer (decided 2026-07-29): a chart is declarable only where the tool already returns the grain the chart wants. To chart revenue over time, add a rollup that groups to one row per period.

  • get_revenue_monthly โ€” finer monthly breakdown.
  • get_revenue_annual โ€” yearly rollup.