rank_by_column
Rank groups by any numeric value to identify top donors, regions, or funds in climate finance data. Supports filters and ordering.
Instructions
Rank any grouping column by any numeric column in any dataset.
When to use:
- Top donors or contributors by pledged or deposited amount
(pledges.csv, group_by contributor or country).
- Regional or recipient analysis (projects.csv, group_by
world_bank_region or country).
- LDC vs non-LDC, SIDS, sector (e.g. agriculture), grant vs loan —
group_by the relevant column on projects.csv.
- Which funds approve the most projects (fund.csv,
value_column=number_of_projects_approved).
- Ascending or descending order (ascending parameter).
Do NOT use when:
- The dataset is long-format (stage as row values) and you rank by
stage — use rank_entities instead.
- On fund.csv you only need standard pipeline stage totals ranked —
prefer rank_entities(filename='fund.csv', group_by='fund',
stage=...) for pledge/deposit/approval/disbursement.
'value_column': any numeric column in the file.
'filters': optional {column: value | [value, ...]} dict to narrow rows
before ranking. List values use OR logic (any match kept).
If a string value does not match exactly, substring fallback is tried:
unambiguous → auto-resolved with filter_resolutions in response;
ambiguous → error listing candidates; no match → error listing
available values for that column.
'top_k': number of groups to return (default 20, max 100). Check
total_groups_found in the response to see if results were truncated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_k | No | ||
| filters | No | ||
| filename | Yes | ||
| group_by | Yes | ||
| ascending | No | ||
| value_column | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||