Get total revenue for a period
get_revenue_for_periodSum revenue (quantity × unit price) for orders within an optional date range, ignoring cancelled orders; returns zero for periods without matches.
Instructions
Sums revenue (quantity * unit_price) across all orders in the requested period, or the whole dataset if no bounds are given. Orders with status 'cancelled' are always excluded from this metric. A period with no matching orders is a successful zero-revenue result, not an error. Optional half-open UTC interval [from, to). Both are 'YYYY-MM-DD'. Omitting a bound leaves that side open (e.g. only 'to' means "everything before to"). 'from' must be strictly earlier than 'to' or the call is rejected. Use this to answer 'how much revenue did we generate in 2025?' (pass from='2025-01-01', to='2026-01-01').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| from | No |