Savings rate month by month
get_savings_rateCalculate your monthly savings rate from YNAB income and spending. Get figures for income, spending, saved amounts, and savings percentage.
Instructions
How much of the income was kept, month by month: income, spending, saved, rate.
Use it for "what's my savings rate?", "how much do I put aside each month?" or "am I saving more than last spring?". Income is money in categorised to Ready to Assign on the budget accounts; starting balances and transfers are not income. Spending is money out of the budget accounts less refunds (money in categorised to a spending category); transfers between budget accounts are left out, a transfer to a tracking account holding an asset (savings, investments) is saved, a transfer to a tracking loan is spending. Saved is income plus spending; rate is saved over income, in percent, null for a month without income. Complete months only, from the budget's first transaction. Relay the notes with the figures. Amounts in currency units, spending negative. For spending per category use get_spending_trends. Three YNAB requests: accounts, categories, transactions; changes nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan_id | Yes | YNAB plan id or 'last-used'. | |
| months_count | No | Complete months to measure, before the current one, 1 to 24 (default 6). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rate | Yes | Saved over income for the whole period, in percent to one decimal; null when nothing came in. | |
| notes | Yes | How the figures were counted, to tell the user. | |
| saved | Yes | Saved over the period: income plus spending. | |
| income | Yes | Income over the period. | |
| months | Yes | The complete months measured, oldest first. | |
| message | Yes | The conclusion in one sentence or two, for the agent to relay. | |
| spending | Yes | Spending over the period, negative. | |
| best_month | Yes | The month with the highest rate, YYYY-MM; null when no month had income. | |
| worst_month | Yes | The month with the lowest rate, YYYY-MM; null when no month had income. | |
| average_saved | Yes | Saved per month, on average over the months measured. | |
| moved_to_tracking | Yes | Money moved to tracking accounts that hold an asset over the period, part of saved. |