rank_entities
Rank entities by financial stage totals (pledge, deposit, approval, disbursement) using wide or long layout. Apply optional filters before ranking.
Instructions
Rank entities by a finance STAGE total: pledge, deposit, approval, or
disbursement. Supported layouts: wide (one column per stage, e.g.
fund.csv) or long ('stage' + 'amount' columns).
When to use:
- Ranking by a pipeline stage column (pledge/deposit/approval/
disbursement), especially on fund.csv (e.g. top funds by pledged
amount, most deposits received).
Do NOT use when:
- Ranking donors, contributors, countries, regions, or projects —
use rank_by_column on pledges.csv or projects.csv with the right
group_by and value_column.
- Ranking by number_of_projects_approved, ratios, percentages, or
non-stage numeric columns — use rank_by_column or
fund_conversion_ratios / filter_funds_by_threshold as appropriate.
- You need ascending sort — use rank_by_column.
'stage': pledge | deposit | approval | disbursement.
'filters': optional {column: value} dict to narrow rows before ranking.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stage | Yes | ||
| top_k | No | ||
| filters | No | ||
| filename | Yes | ||
| group_by | Yes | ||
| stage_col | No | stage | |
| amount_col | No | amount |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||