On Sun, Apr 22, 2018 at 8:30 AM, Martin Michlmayr <[email protected]> wrote:
> * [email protected] <[email protected]> [2018-04-21 05:37]: > > As the title says i wonder when to use tags and when to create > > separate account? > > There is no right or wrong. Some people like to put a lot of > information into their account names while others prefer simple account > names. My general impression is that professional accounts prefer a > simple chart of accouts, though. > > > Or should i use same accounts > > > > Income:Business: > > Expenses:Business:Ads > > Expenses:Business:Hosting > > > > and just use tags #ECOM1 and #ECOM2 ? > It's an arbitrary choice. The true question is about how you want to query it. Consider this: Beancount essentially produces a single table of postings whose fields are always joined with the fields of the transaction which contains them. e.g. <transaction-fields> <posting-fields> It all boils down to how you want to aggregate them. You can aggregate them by account name. You can aggregate them by tag. You can aggregate them by combinations of those (and other fields as well). The default reports (balance sheet, income statement) use the account names to produce aggregations, so that's one consideration, but it doesn't matter much, as in a future version of Beancount, the reports will be produced by queries as well (more easily customizable in that way). Personally, I like simple account names so I'd go with that plus tags. > > Ledger has an interesting concept called pivot which allows you to do > both. It allows you to make metadata information to become part of > the account name. > > e.g.: > > 2018-04-22 * Income from ABC > Assets:Bank 100.00 EUR > Income:Business:Hosting -100.00 EUR > ; Customer: ABC > > 2018-04-22 * Income from CDE > Assets:Bank 150.00 EUR > Income:Business:Hosting -150.00 EUR > ; Customer: CDE > > Normal balance: > > ledger -f a bal income > -250.00 EUR Income:Business:Hosting > > Balance with --pivot: > > ledger -f a bal income --pivot Customer > -250.00 EUR Customer > -100.00 EUR ABC:Income:Business:Hosting > -150.00 EUR CDE:Income:Business:Hosting > -------------------- > -250.00 EUR > > The same would be easy to do with a beancount plugin. I don't know if > anyone has done it already. If not, I intend to create one in the > near future. > You can achieve the same thing already with a group-by on the (account, meta) pair: plugin "beancount.plugins.auto" 2018-04-22 * "Income from ABC" customer: "ABC" Assets:Bank 100.00 EUR Income:Business:Hosting -100.00 EUR 2018-04-22 * "Income from CDE" customer: "CDE" Assets:Bank 150.00 EUR Income:Business:Hosting -150.00 EUR ;; bean-query /home/blais/r/q/beancount-data/user/michlmayr/groupby.beancount ;; "select account, entry_meta('customer'), sum(position) where account ~ 'Income' group by 1, 2" ;; account ent sum_positio ;; ----------------------- --- ----------- ;; Income:Business:Hosting ABC -100.00 EUR ;; Income:Business:Hosting CDE -150.00 EUR -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhOMk-pCvD7B45%2Bmj5q_G28EbOxx7cJFJ3X-1Y97p5MXzg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
