get_cash_flow_forecast โ Cash-Flow Forecast
Expected A/R collections from open invoices due within the next N days, bucketed by week with a running total.
This is a Named SQL Query (SAP
/SQLQueries) โ dynamic
aggregate SQL returning per-query rows, not a fixed Service Layer entity.Cash-flow-forecast report โ expected A/R collections from open invoices due within the next
N days, bucketed by week with a running cumulative total. Returns one row per week with
week_label, week_start, invoice_count, expected_amount (sum due that week), and
cumulative_total (running total across earlier weeks), soonest first. Forward-looking; only
open (unpaid) invoices count.
Try these prompts
- “show me the cash flow forecast”
- “what cash is coming in over the next month?”
- “cash coming in over the next 90 days”
- “expected collections as of 2025-12-31”
ื ืกื ืื ืืขืืจืืช
- “ืืฆื ืชืืืืช ืชืืจืื ืืืืื ืื”
- “ืืื ืืกืฃ ืฆืคืื ืืืืื ืก ืืืืืฉ ืืงืจืื?”
- “ืื ืืืืืื ืืฆืคืืื ืืฉืืืฉืช ืืืืืฉืื ืืืืื?”
Arguments
| Arg | Required | Meaning |
|---|---|---|
days | optional | Forecast horizon, 1-365 (default 30). Out-of-range values are clamped. |
as_of_date | optional | YYYY-MM-DD โ forecast as of this date. Omit for today. |
Example result
$14,500 expected over the next four weeks. Week of 2025-07-21 โ 3 invoices, $6,200 (cumulative $6,200). Week of 2025-07-28 โ 2 invoices, $3,800 (cumulative $10,000).
Result columns
| Column | Type | Meaning |
|---|---|---|
week_label | text | The bucket’s label, e.g. Week 1 โ weeks counted forward from the as-of date. |
week_start | date | The first day of that week. |
invoice_count | number | How many open invoices fall due inside that week. |
expected_amount | number | Total due that week. |
cumulative_total | number | Running total of expected_amount across this week and every earlier one. |
Charts
- line: x=week_label, y=expected_amount,cumulative_total, title=“Expected collections by week”
Related
get_ar_agingโ which customers already owe and how overdue (backward-looking).get_ap_agingโ the outgoing payables side.