I just noticed one problems with the use of PARENT(). This assumes that all of your accounts have the same depth.
It might be better to use something like splitcomp(account, ":", 1). This will give "Foo" for both Expenses:Foo:Bar and Expenses:Foo Whereas PARENT(account) would give Expenses:Foo for the first and Expenses for the latter. (Daniele, is there a nicer way than splitcomp(account, ":", 1)? Getting a particular subaccount seems pretty common. Also, I couldn't figure out a way to extract 2 subaccounts - Expenses:Foo:Bar should yield Expenses:Foo and Expenses:Foo should also yield Expenses:Foo; is that possible?) * Martin Michlmayr <[email protected]> [2023-12-21 18:51]: > bean-report is deprecated. > > You can do the following in bean-query: > > SELECT PARENT(account), position, balance WHERE account ~ 'Expenses:Test:' > > you can also use PARENT(PARENT(account)) > > This is for register report. For balance report, something like that: > > SELECT PARENT(account), SUM(position) WHERE account ~ 'Expenses:Test:' GROUP > BY PARENT(account) > > (There might be more elegant ways of doing this, but the queries above > work for me.) > > Martin > > > * Dan Andersson <[email protected]> [2023-12-21 02:38]: > > Hi, > > > > Example bean-report output: > > > > Expenses:Test:Foo 2 USD > > > > Expenses:Test:Foo 4 USD > > > > How can I automatically show summations for all super-accounts? For > > example > > > > Expenses 6 USD > > > > Expenses:Test 6 USD > > > > Expenses:Test:Foo 2 USD > > Expenses:Test:Foo 4 USD > > Thanks, > > Dan > > > > -- > > 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 [1][email protected]. > > To view this discussion on the web visit > > [2]https://groups.google.com/d/msgid/beancount/ff1ad476-8e0c-4cd2-ac1c- > > 4eec19af8554n%40googlegroups.com. > > > > References > > > > 1. mailto:[email protected] > > 2. > > https://groups.google.com/d/msgid/beancount/[email protected]?utm_medium=email&utm_source=footer > > -- > Martin Michlmayr > https://www.cyrius.com/ -- Martin Michlmayr https://www.cyrius.com/ -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/beancount/20240102073349.GA1521834%40jirafa.cyrius.com.
