New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] [Feature] Financial cashflow forecast #2674
base: master
Are you sure you want to change the base?
Conversation
Missed a few things in the rebase. Cater for transfers, account filtering and off-budget accounts.
- Refactored some of the date handling to minimise changes to existing code and fix some edge case bugs when months don't have 31 days. - Added a feature flag
Non repeating schedules store their dates differently to the repeating kind. Add the date directly instead of using the 'get-occurrances...' function.
- Make isConcise dependent on forecast length as well - Style line and bars based on isFuture - Remove explicit future data keys from graph
- Map graphData per date - Separate stacked bars for future and past - Separate labels for past and future
- Dummy average source - Minor visual fix on buttons - Minor formatting
- Exclude current incomplete month - Calculcate average of all months to fill in data - Account for this month's spending in forecast amont for this month - Filter out starting balance
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged No assets were unchanged |
I'd like to suggest this is limited to the past 1 or 2 Junes, using myself as example, I used Actual before it went free, and imported nYNAB data, I have a number of years of data (back to 2017) and so averaging all those Junes will generate an number not as representative as it could be. I think moving with the last 1 or 2 years is better as personal circumstances change. Likewise others have imported years of data from nYNAB and YNAB4. I lean towards just the last year for my personal circumstances to reflect changes, but see using the last 2 as perfectly valid as well Got an error when trying to add a filter: (Same error occurred when using the Average Spending Option) Also recommend checking all the other filter options for the same. |
This is great! Thanks for picking it up and contributing! I lost a bit of steam and never really pushed it any further after the PR was closed... The community seemed a little divided on how it should work and with the change in graphing library, I never found the time/motivation. I did extend it to also use the budget as a source, very similar to how you've done it, see: mk-french@9b2a73c but I hadn't pushed it before the PR was closed. If I get a moment, I'll try merge it with your changes here. Also I think there may have been a few bugs fixed along the way... I also echo the issue of including too many years in the past. When testing, my August forecast expense has blown out because of a house purchase from many years back! 😂 There's lot's of work to be done around the filtering, as some of the filtering options don't make sense in some contexts... |
I suppose you can't run two filters? One for the current cashflow graph as-is, and another for the forecast based on average spending? Say if I would have had extraordinary expenses that I want in the cashflow graph, but not show in the forecast. |
- Query schedules/transactions only when relevant - Exclude impossible schedule filters - Fix divide by 0 when averaging.
Hi all, thank you for the testing and suggestions :) The point of wanting to limit the number of past years considered is a good one. I have (I hope, though I still struggle to test this) added the option to limit the number of years. That may be a bit overkill, but I think we might as well add features until it becomes clear what sticks. As to the filtering errors, they should be resolved. However, the filtering options for schedules are limited to account and payee, while date (speaking of filtering options that don't make sense in context...) and amount should be possible as well. Then to better forecasting, I like both of these ideas.
In the trend of throwing features at the wall to see what sticks, I'll definitely have a go at implementing separate filtering for the forecast. If that doesn't adequately deal with outliers, well... we'll see.
Definitely, do you have any concrete examples? |
Hi! I think the average x years isn't working, I have a big lump sum I made in February and so I'd expect the curve to change a lot if I use more years than 1. Can see the forecast line looks the same regardless of 1 or 10 years and the big drop in February to affect numbers that more years would have smoothed out Extreme example, all time history, max forecast: Regarding filtering, instead of having two sets of filters, maybe instead(if you think it's a good idea, technically doable, etc etc.) might be to simply reset the filters when changing between Average Spending and Schedules (optional toast window to let them know). Then the filter options list itself could be filtered for only what makes sense for each option. I can kinda see a case for having a different filter list that only applies to the forecasted portion, but even done this way, I think resetting them when changing options is a clean simple way to avoid breakages with incompatible filters and communicate to the user the different availability In terms of editing the filtering list, Carkom did this in #2622 so if you want to(ideally) filter the filter list options based on which forecast is option is used it might help you. :) |
$transform: '$month', | ||
$lte: monthUtils.prevMonth(end), | ||
$gt: monthUtils.subMonths(end, forecastDivideYears * 12), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure how to contribute to your PR (I can't push to your branch in your repo due to permissions) but you need to split these into seperate objects and combine them with an $and operator.
#2674 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nsulzer , I have the above fix and also the budget source merged in and ready to push. I've created a PR to your branch.
Attempt to contribute to #2673 to continue the conversation and get some feedback.
Most of it is based on on #2126, with the addition of forecast based on past averages, and a move to Recahrts. Average spending is based on the average of the relevant month in past years (so the June projection is the average of all June's). If there is no data, it will take the average of all available months.
I am extremely open to feedback. I hope this can help move the discussion along and work towards something good :)