Query to get transactions involving some account?

55 views
Skip to first unread message

Juan Antonio Navarro Pérez

unread,
Oct 10, 2021, 4:49:17 AM10/10/21
to Beancount
I would like to write a query that matches all postings from transactions that involve a particular account. For example something like:

  SELECT date, account, position FROM account ~ "Assets:Foo"

Where I want to see not just postings for "Assets:Foo" (as WHERE account ~ "Assets:Foo" would do); but also postings for Income/Expenses showing the accounts where the units in Assets:Foo are coming from/going to.

Is such a thing possible?

Martin Blais

unread,
Oct 10, 2021, 8:33:17 AM10/10/21
to Beancount
Look for the HAS_ACCOUNT() function if I recall correctly

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/beancount/09fc9b9a-5f91-41d2-8194-c41646a9ab31n%40googlegroups.com.

Juan Antonio Navarro Pérez

unread,
Oct 10, 2021, 1:01:48 PM10/10/21
to Beancount
Fantastic! That works, thanks!
Reply all
Reply to author
Forward
0 new messages