get_revenue_yoy โ Year-over-Year Revenue
Revenue per year with the year-over-year growth % and a YTD-vs-last-year comparison, from posted A/R invoices.
/SQLQueries) โ dynamic
aggregate SQL returning per-query rows, not a fixed Service Layer entity.Year-over-year revenue report โ how revenue changed from year to year. Returns one row per
year (newest first) with the year’s revenue, the prior_year_revenue, the yoy_delta and
yoy_growth_pct, plus a like-for-like year-to-date comparison: ytd_revenue (Jan 1 โ the
as-of date), prior_ytd_revenue (the same window one year earlier), and ytd_growth_pct. Revenue
is taken from posted A/R invoices, aggregated across all customers into a single trend line.
Try these prompts
- “how much did revenue grow year over year”
- “revenue YTD vs last year”
- “what was our revenue growth in 2025?”
- “year-over-year revenue for C003”
- “how has revenue trended since 2023”
- “compare revenue by year”
ื ืกื ืื ืืขืืจืืช
- “ืืื ืืืื ืืืื ืกืืช ืืฉื ื ืืฉื ื?”
- “ืืฉืืื ืืื ืกืืช ืืฉื ื ืฉืขืืจื”
- “ืื ืืื ืฉืืขืืจ ืืฆืืืื ืืืื ืกืืช?”
Arguments
| Arg | Required | Meaning |
|---|---|---|
card_code | optional | One customer, e.g. C003. Omit for all customers. |
as_of_date | optional | The YTD cut-off (YYYY-MM-DD) โ the year-to-date figure runs Jan 1 to here, compared against the same window last year. Omit for today. |
Example result
Revenue is up on the year, but Q3 softened 2025. 2026 โ $48,000 so far, YTD +45% vs the same point in 2025 ($33,000). 2025 โ $61,500, +2.5% on 2024. 2024 โ $60,000, +29% on 2023’s $46,500.
Result columns
| Column | Type | Meaning |
|---|---|---|
year | number | The calendar year. Declared number because that is what the row holds (int32 in the query); it is charted as an x-axis label, but the type states the DATA, not the axis role. |
revenue | number | Revenue posted in that year, from posted A/R invoices. |
prior_year_revenue | number | The prior year’s revenue (0 for the earliest year). |
yoy_delta | number | revenue minus prior_year_revenue. |
yoy_growth_pct | number | Growth vs the prior year, percent. |
ytd_revenue | number | Revenue from Jan 1 to the as-of date, this year. |
prior_ytd_revenue | number | The same Jan-1-to-as-of-date window, one year earlier. |
ytd_growth_pct | number | Growth of ytd_revenue vs prior_ytd_revenue, percent. |
Charts
- line: x=year, y=revenue, title=“Revenue over time”
- bar: x=year, y=yoy_growth_pct, title=“YoY growth”
Related
get_revenue_annualโ the plain per-year totals (with customer / salesperson breakdown).get_revenue_quarterly/get_revenue_monthlyโ finer breakdowns.