qobrix_timeseries
Aggregate Qobrix CRM records into metrics (count, sum, avg, min, max) bucketed by day, week, month, quarter, or year, with date filters and optional prior-period comparison.
Instructions
Time-bucketed metric (count / sum / avg / min / max) over any resource. Paginates once over the window, buckets in-process by day/week/month/quarter/year (default 'month'). Per-resource default date_field: contracts→date_of_contract, opportunities/properties/calls/etc.→created. Use search to filter (e.g. only closed sales). Set compare_to_prior=true to also fetch the prior identical-length window for YoY %. Example uses: Monthly 2026 closed-sale volume with YoY: resource='contracts', metric='sum', field='final_selling_price_amount', year=2026, search='contract_type == "cos" and contract_status == "agreed"', compare_to_prior=true. Weekly lead intake last 90 days: resource='opportunities', bucket='week', metric='count', since_days=90. Quarterly listing additions 2026: resource='properties', bucket='quarter', year=2026, metric='count'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ISO date (YYYY-MM-DD) exclusive upper bound. | |
| from | No | ISO date (YYYY-MM-DD) inclusive lower bound. | |
| year | No | Calendar year window. | |
| field | No | Numeric field aggregated by `metric` (required when metric != 'count'). Examples: 'final_selling_price_amount' (contracts), 'budget' (opportunities). | |
| bucket | No | Bucket size (default 'month'). 'week' uses ISO weeks starting Monday. | |
| metric | No | Aggregation inside each bucket (default 'count'). Anything other than 'count' requires `field`. | |
| search | No | Extra raw Qobrix search expression ANDed with the date window. | |
| resource | Yes | Resource name (case-sensitive, lowercase plural as used by Qobrix API). Values: properties, opportunities, contacts, agents, tasks, property-viewings, projects, offers, contracts, calls, meetings, email-messages. | |
| date_field | No | Date column to bucket on. Defaults per-resource: contracts → date_of_contract, opportunities → created, properties → created, calls/meetings/email-messages/tasks → created. | |
| since_days | No | Rolling window: only rows dated within the last N days. Mutually exclusive with year/from/to. | |
| compare_to_prior | No | If true, runs the same query over the prior identical-length window and returns a `prior` block + YoY % diffs (when buckets line up). |