Analyze a field across requests
analyze_fieldAggregate any workflow field across the requests this user can see, as a database aggregate rather than by listing requests and adding them up. Numeric fields support sum/average/max/min; any field supports rank (the most common values and their counts). group_by_label cross-tabulates two fields on the same request: field_label='Amount', operation='sum', group_by_label='Vendor' answers 'what did we spend per vendor'. dimension groups by a built-in property instead — status, workflow, requestor, or day/week/month for volume over time. Works on LINE-ITEM columns as well as ordinary fields, and pairs cells from the same line, so 'spend on laptops' is answerable. Refer to fields by the label shown on the form; use get_workflow_details if unsure of the exact wording. Read note before quoting money — currency fields are stored in MINOR units — and repeat any warnings rather than presenting a truncated breakdown as complete.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dimension | No | Break requests down by a BUILT-IN property instead of a workflow field. `month`, `week` and `day` give volume over time — that is what 'a graph of requests over the past year' means. `status`, `workflow` and `requestor` give the mix. Pass this OR `field_label`, not both. | |
| operation | No | `rank` counts requests per value and works on every field. The rest need a numeric field. | rank |
| field_label | No | The field to analyse, named as a person would say it — 'Country', 'Amount', 'Storage size', 'Item'. Use this for anything a WORKFLOW defines. For built-in properties of a request, use `dimension`. | |
| created_after | No | Only requests submitted on/after this date (YYYY-MM-DD). | |
| field_filters | No | Narrow to requests whose FIELD VALUES match, by the field's name on the form. This is how you answer 'invoices from Acme', 'requests where Country is Germany', or 'which requests have a laptop on them' — the last one works because line-item table columns are matched too, not just fields on the form itself. Combine freely with the other filters; several entries all have to match the same request. Prefer this over `search` when the user names a field and a value, because `search` is free text over the whole request and will also match a mention in a description. Use `get_workflow_details` if unsure what a workflow calls a field. | |
| created_before | No | Only requests submitted on/before this date (YYYY-MM-DD). | |
| group_by_label | No | Optional second field to break the result down by — 'sum of Amount grouped by Country' gives spend per country. Only meaningful with a numeric operation. | |
| workflow_query | No | Optional workflow-name substring. Scoping to one workflow makes the answer exact, because a label can mean different things in different workflows. |