get_revenue_annual โ€” Annual Revenue

How much we invoiced per customer and salesperson, by year, 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.

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

Try these prompts

  • “show me annual revenue”
  • “how much did we invoice in 2025?”
  • “yearly revenue”
  • “annual revenue for C001”

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

  • “ื”ืฆื’ ื”ื›ื ืกื•ืช ืฉื ืชื™ื•ืช”
  • “ื›ืžื” ื—ื™ื™ื‘ื ื• ื‘ืฉื ื” ืฉืขื‘ืจื”?”
  • “ืžื” ื”ื”ื›ื ืกื” ื”ืฉื ืชื™ืช?”

Arguments

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

Example result

2025 topped $100k. 2025 โ€” C001 Acme Corp $110,000; C002 Beta Industries $62,000. 2024 โ€” C001 Acme Corp $88,000.

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.
period_labeltextThe same year rendered for display, e.g. 2025.
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 year ร— customer ร— salesperson.

Charts

None. This tool returns one row per period ร— customer ร— salesperson, so period_label repeats across rows and a bar keyed on it would draw the same year 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. get_revenue_yoy is the already-aggregated tool for this question, and it does declare charts.

  • get_revenue_quarterly / get_revenue_monthly โ€” finer breakdowns.