You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems the cumulative expense graph that is displayed when you go to the Expenses tab and then click on an account does not handle currency conversion correctly.
This is what our grocery expenses look like over time, converted to SEK:
As you can see, it is not cumulative. Sometimes the total expenses appear to decrease. I believe what's happening here is that fava (or beancount, I don't know where the calculation is done) accumulates our grocery expenses in USD and SEK separately and then, for each point on the graph, converts the USD value to SEK and adds them. This means that if we have an accumulated expense of 10,000 USD in Jan 2025 and the exchange rate changes such that those USD are now worth less SEK, the expense line will decrease.
This seems like a useless way of doing the currency conversion since those USD were spent at some time in the past, and just because USD is worth less right now doesn't mean that our expenses back at that time changed. I think a more useful way of doing the calculation is that, for each interval, the USD value is converted to SEK using the exchange rate at that point in time, and then the running sum of SEK is displayed.
Ie, instead of plotting, in pseudocode, y(T)=Sum(USD(t),0,T)*(SEK/USD)(T) + Sum(SEK(t),0,T),
the plot should be y(T)=Sum(USD(t)*(SEK/USD)(t)+SEK(t),0,T).
I'm doing this with fava 1.29 on Chrome 131.0.6778.139.
The text was updated successfully, but these errors were encountered:
It seems the cumulative expense graph that is displayed when you go to the Expenses tab and then click on an account does not handle currency conversion correctly.
This is what our grocery expenses look like over time, converted to SEK:
As you can see, it is not cumulative. Sometimes the total expenses appear to decrease. I believe what's happening here is that fava (or beancount, I don't know where the calculation is done) accumulates our grocery expenses in USD and SEK separately and then, for each point on the graph, converts the USD value to SEK and adds them. This means that if we have an accumulated expense of 10,000 USD in Jan 2025 and the exchange rate changes such that those USD are now worth less SEK, the expense line will decrease.
This seems like a useless way of doing the currency conversion since those USD were spent at some time in the past, and just because USD is worth less right now doesn't mean that our expenses back at that time changed. I think a more useful way of doing the calculation is that, for each interval, the USD value is converted to SEK using the exchange rate at that point in time, and then the running sum of SEK is displayed.
Ie, instead of plotting, in pseudocode,
y(T)=Sum(USD(t),0,T)*(SEK/USD)(T) + Sum(SEK(t),0,T)
,the plot should be
y(T)=Sum(USD(t)*(SEK/USD)(t)+SEK(t),0,T)
.I'm doing this with fava 1.29 on Chrome 131.0.6778.139.
The text was updated successfully, but these errors were encountered: