Cookbook comment/question

72 views
Skip to first unread message

jonath...@gmail.com

unread,
Jan 10, 2019, 7:04:31 PM1/10/19
to Beancount
Was going to leave this as a doc comment on the cookbook, but it seems to be view-only.

In the beancount cookbook, and pervasively throughout the documentation, you recommend naming e.g. dividend income accounts with names like Income:US:ETrade:Dividends.

This surprises me: I would expect you would prefer a name like Income:US:Dividends:ETrade instead. It's true that you will need to have these items broken out by account for tax reporting, but you want the totals by income/expense taxation category (dividend, P&L, wages, interest) as well, and I assume it's at least marginally more convenient to get reports for a level of hierarchy than for an arbitrary filter. (Of course it is easy to slice things up however I want when I need to; this is what drew me to beancount in the first place. So the question is really just about what makes for more useful/convenient defaults.)

Am I missing an important use for which it's good to have income/expense category nested below, rather than above, account?

Stefano Zacchiroli

unread,
Jan 11, 2019, 2:49:31 AM1/11/19
to bean...@googlegroups.com
On Thu, Jan 10, 2019 at 04:04:31PM -0800, jonath...@gmail.com wrote:
> Am I missing an important use for which it's good to have income/expense
> category nested below, rather than above, account?

I don't remember if it is part of the current doc but Martin presented,
and we discussed on list a while a go, a very convincing view in which
the different parts of an account name are really just "facets".

In your example one would be the major account type imposed by
double-entry accounting, one would be the country, etc. If you think of
it that way, the different linearizations into strictly hierarchical
taxonomies become pretty arbitrary.

You should pick what makes the most sense for you in terms of how often
you add up the result of queries at a given node in the taxonomy, and do
the other groupings by hand when you really need to (he fact that with
BQL you generally match accounts using regular expression makes this
very convenient to do.) But there is no "strong right" or "strong wrong"
way of doing it.

Cheers
--
Stefano Zacchiroli . za...@upsilon.cc . upsilon.cc/zack . . o . . . o . o
Computer Science Professor . CTO Software Heritage . . . . . o . . . o o
Former Debian Project Leader & OSI Board Director . . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »

Martin Blais

unread,
Jan 11, 2019, 4:17:14 AM1/11/19
to Beancount
On Fri, Jan 11, 2019 at 11:04 AM <jonath...@gmail.com> wrote:
Was going to leave this as a doc comment on the cookbook, but it seems to be view-only.

I had to lock them down, because I was getting too much accidental fingerfart to fix every day.


In the beancount cookbook, and pervasively throughout the documentation, you recommend naming e.g. dividend income accounts with names like Income:US:ETrade:Dividends.

This surprises me: I would expect you would prefer a name like Income:US:Dividends:ETrade instead. It's true that you will need to have these items broken out by account for tax reporting, but you want the totals by income/expense taxation category (dividend, P&L, wages, interest) as well, and I assume it's at least marginally more convenient to get reports for a level of hierarchy than for an arbitrary filter. (Of course it is easy to slice things up however I want when I need to; this is what drew me to beancount in the first place. So the question is really just about what makes for more useful/convenient defaults.)

That's right.
 

Am I missing an important use for which it's good to have income/expense category nested below, rather than above, account?

I think it's up to how you want the hierarchical reporting to work for you.
You can view these account name components as "tags", and as you surmise, you can filter them arbitrarily using regexps.
However, there's currently only one "hierarchical" way to break these down, and that's fixed off the order of the names in how you select your account names. Note that if you need multiple hierarchies, you could write a plugin to rewrite all your account names to a different ordering, or build some custom reporting code that does that for you. That's always an option.

But essentially as Stefano mentions, the right logical view for the contents of your Beancount file is as a gigantic table of postings, and the process of reporting is first filtering those rows, and then doing aggregations/breakdowns ("group by", summing the contents with the inventory semantics). One could in theory do transformations on the account name to pull out particular subsets of components (e.g. Dividend, CapitalGain, etc. could be one such group). Generally speaking regular expressions will take you a long way and I haven't found it worthwhile to push in the direction of formalizing the account name components yet.

Cheers,

Jonathan Klabunde Tomer

unread,
Jan 11, 2019, 12:12:51 PM1/11/19
to bean...@googlegroups.com
Thanks!

--
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/MqIk8nfgtx0/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAK21%2BhOW-0eExDheYFZDRtcN0G%3DKDpJSkeMaUcurcd3VCa%3DAxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages