Top N Transactions
top_nReturns the top N groups by a selected metric, showing per-currency results for monetary values. Supports optional filters for accounts, products, and date ranges to scope the analysis.
Instructions
Return the top N groups ranked by metric (descending), per-currency for monetary metrics. Scope defaults to all your completed statements; pass "scope" to narrow to specific accounts/products and/or a date range.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | Yes | Number of top groups to return. | |
| scope | No | Optional structural scope (WHO × WHEN). Omit to search across all your completed statements. "accounts" is a list of account/product chips (kind + identityKey); "dateRange" bounds by transaction date (YYYY-MM-DD). | |
| filter | No | Subset of transactions to operate on. All fields are optional and combined with AND logic. | |
| metric | Yes | Metric to rank by. | |
| dimension | Yes | Grouping dimension. |