reporting balances in terms of only one currency like ledger's -X option

495 views
Skip to first unread message

gksrn...@gmail.com

unread,
Aug 5, 2017, 8:00:12 AM8/5/17
to Beancount
Hi. I'm trying Beancount instead of Ledger.

Sometimes I use another currency in business trips.

I want to check my balances in temrs of the our currency.

Ledger can do this by using -X option.

How to do this in Beancount?

Thanks in advance,
Hankook Lee

Martin Blais

unread,
Aug 5, 2017, 12:58:24 PM8/5/17
to Beancount
You can use the SQL shell's conversion function to do this.
Something like this:

bean-query /tmp/example.beancount "select account, convert(sum(position), 'CAD') group by 1 order by 1"

It'll be able to convert as long as you have at least some price directives in your file to provide the exchange rate (Beancount does not access the network on purpose - deterministic, repeatable, no unexpected things - so it won't pull rates form anywhere; you have to have rates inserted in your file).



--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/b1d52a31-67d5-4043-bf57-01c8e0ff03ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Chu

unread,
Aug 5, 2017, 2:02:15 PM8/5/17
to Beancount

Fava has a drop-down that will convert all tree charts (income statement and balance sheets) to any currency. It uses the same convert functions as sql.


On Sat, Aug 5, 2017, 9:58 AM Martin Blais <bl...@furius.ca> wrote:
You can use the SQL shell's conversion function to do this.
Something like this:

bean-query /tmp/example.beancount "select account, convert(sum(position), 'CAD') group by 1 order by 1"

It'll be able to convert as long as you have at least some price directives in your file to provide the exchange rate (Beancount does not access the network on purpose - deterministic, repeatable, no unexpected things - so it won't pull rates form anywhere; you have to have rates inserted in your file).


On Sat, Aug 5, 2017 at 8:00 AM, <gksrn...@gmail.com> wrote:
Hi. I'm trying Beancount instead of Ledger.

Sometimes I use another currency in business trips.

I want to check my balances in temrs of the our currency.

Ledger can do this by using -X option.

How to do this in Beancount?

Thanks in advance,
Hankook Lee

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/b1d52a31-67d5-4043-bf57-01c8e0ff03ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.

gksrn...@gmail.com

unread,
Aug 6, 2017, 10:03:05 AM8/6/17
to Beancount
I tried the two options: 1) using query and 2) using fava. These solutions work!

Thanks!



2017년 8월 6일 일요일 오전 4시 2분 15초 UTC+10, Jason Chu 님의 말:
Message has been deleted

Martin Blais

unread,
Mar 30, 2018, 11:15:45 PM3/30/18
to Beancount
I'm not sure how to change that, but  I just quickly checked Fava's source code for fun, it seems Fava isn't using source code from beancount.report at all.
(This is a good thing, as I'd like to transition to SQL-based reports only and delete all that code eventually, an SQL version would be much more flexible.)



On Wed, Mar 28, 2018 at 9:18 AM, <hoongsh...@oromico.com> wrote:
Hi,

I am trying to use Fava and have an issue with the FX rate used.

In my beancount file I have different rates for different dates. I expect the income statement to convert based on the FX rate of the date of the transaction - 

  bean-query> SELECT date, narration, account, position, getprice(currency,"IDR", date), convert(position, "IDR", date)

but instead it just takes the latest FX rate in the file which is wrong

   bean-query> SELECT date, narration, account, position, getprice(currency,"IDR", date), convert(position, "IDR")

How do I get bean-report or fava to switch to the first query instead of the second for the income report?

Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.

To post to this group, send email to bean...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages