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

ArgRequiredMeaning
daysoptionalForecast horizon, 1-365 (default 30). Out-of-range values are clamped.
as_of_dateoptionalYYYY-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

ColumnTypeMeaning
week_labeltextThe bucket’s label, e.g. Week 1 โ€” weeks counted forward from the as-of date.
week_startdateThe first day of that week.
invoice_countnumberHow many open invoices fall due inside that week.
expected_amountnumberTotal due that week.
cumulative_totalnumberRunning 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”
  • get_ar_aging โ€” which customers already owe and how overdue (backward-looking).
  • get_ap_aging โ€” the outgoing payables side.