Beancount Query to get market value at past date

104 views
Skip to first unread message

Renato Candido

unread,
Feb 27, 2021, 5:43:33 PM2/27/21
to bean...@googlegroups.com
Hi everyone,

I'm trying to get a list with my accounts and market value positions at a past date. I am using the following query:

SELECT account, value(sum(position)) FROM flag != "!" CLOSE ON 2021-01-31 GROUP By account ORDER BY account

For the accounts in USD, the positions are all correct. However, for the accounts involving other commodities, value() is calculating the market value using the most recent price I have in the ledger, not the one from the past date.

I've looked at this documentation and it says the following:

”value”: render the amount at the market value of the last entry rendered.

As I'm using CLOSE ON in the query, shouldn't value() render the market_value at the past date (in this case 2021-01-31)?

Am I missing something?

Thanks,

Renato
Reply all
Reply to author
Forward
0 new messages