Difference in Fava and bean-query for applying exchange rates

36 views
Skip to first unread message

kprab...@gmail.com

unread,
Aug 27, 2025, 3:31:35 AMAug 27
to Beancount
Team,

The exchange rate used by fava follows the convention of using the last price quote available for the previous month for the conversions. 

However, the report generated by bean-query uses a single exchange rate(85.2000) for all transactions across the year for the below query. 

bean-query -f csv -m prabu.beancount 'select date, account, position, convert(position, "INR"), description from date >= 2024-04-01 AND date <= 2025-03-31 where account ~ "Income" and account ~ "Dividend" or account ~ "Interest" or account ~ "withholding" or account ~ "slb"'

I''ll appreciate if someone can explain how to get similar results as fava using bean-query? 

My ledger options are as follows:

option "title" "Prabu Ledger"
option "operating_currency" "INR"
option "insert_pythonpath" "True"
option "inferred_tolerance_default" "*:0.000001"
importers-master/config_prabu.py"
2010-07-25 custom "fava-option" "import-dirs" "Downloads"
2010-07-25 custom "fava-option" "fiscal-year-end" "03-31"
2010-07-25 custom "fava-option" "show-accounts-with-zero-transactions" "False"
2010-07-25 custom "fava-option" "show-accounts-with-zero-balance" "False"
plugin "beancount.plugins.implicit_prices"
plugin "beancount.plugins.auto"


*** Exchange Rates for 2024-2025
; Exchange rates for USD
2024-03-30 price USD 82.9500 INR
2024-04-26 price USD 82.9000 INR
2024-05-31 price USD 83.0500 INR
2024-06-29 price USD 83.0000 INR
2024-07-31 price USD 83.3200 INR
2024-08-31 price USD 83.5000 INR
2024-09-30 price USD 83.3000 INR
2024-10-31 price USD 83.6800 INR
2024-11-30 price USD 84.1500 INR
2024-12-31 price USD 85.2000 INR
2025-01-31 price USD 86.2000 INR
2025-02-27 price USD 86.1500 INR
2025-02-28 price USD 86.9500 INR
2025-03-29 price USD 85.2000 INR

Regards,
Prabu

Chary Ev2geny

unread,
Aug 27, 2025, 4:57:43 AMAug 27
to Beancount
Disclaimer: I do not use Fava.

But most likely in the the report you refer to in Fava, it uses the exchange rate available at the date of the transaction. In another words the latest exchange rate, specified by the price notation with the date equal of less then the date of the transaction. In this case this would follow the generally accepted accounting practices, where when generating a report for P&L accounts one shall use an exchange rate of that day.  

Since in your example of a ledger you specify prices at the end of the month, this would be what you said: the price of the  last month

To do the same in the beanquery you mentioned, you need to do it like that:

convert(position, "INR", date)

Without that, beanquery uses the latest available exchange rate (85.2000  in your case), which, frankly speaking, I am not sure makes much sense from the accounting point of view.

Prabu Anand Kalivaradhan

unread,
Aug 27, 2025, 6:01:18 AMAug 27
to bean...@googlegroups.com
Thanks Chary. The suggested change in bean-query gave the results similar to fava results. 

Also, thank you for the explanation on using the exchange rate of 85.2. Highly appreciated.

--
You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/7MaRtg56y_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/beancount/618029f5-8024-41bc-aaf1-696c73dcaeden%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages