get_revenue_monthly โ€” Monthly Revenue

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

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

Try these prompts

  • “show me monthly revenue”
  • “how much did we invoice per month?”
  • “revenue by salesperson”
  • “monthly revenue from C001”
  • “how has monthly revenue trended since 2023” ยท “which months dipped in 2025”

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

  • “ื”ืฆื’ ื”ื›ื ืกื•ืช ื—ื•ื“ืฉื™ื•ืช”
  • “ื›ืžื” ื—ื™ื™ื‘ื ื• ื‘ื›ืœ ื—ื•ื“ืฉ?”
  • “ืื™ืš ื”ืชืคืชื—ื• ื”ื”ื›ื ืกื•ืช ื”ื—ื•ื“ืฉื™ื•ืช ื‘ืฉื ื™ื ื”ืื—ืจื•ื ื•ืช?”

Arguments

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

Example result

June was your strongest month. 2025-06 โ€” C001 Acme Corp $12,400; C002 Beta Industries $7,800. 2025-05 โ€” C001 Acme Corp $9,100.

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.
monthnumberThe calendar month, 1-12.
period_labeltextYear and month rendered for display, e.g. 2025-06.
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 month ร— 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 month 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_quarterly / get_revenue_annual โ€” coarser rollups.
  • get_gross_margin โ€” revenue with cost, per item.
  • list_ar_invoices โ€” a plain list of invoices.