On Thu, May 14, 2020 at 3:44 PM MN <[email protected]> wrote: > > Hi, > > Say I have the account Expense:Entertainment. > > Under it I have: > > Expense:Entertainment:Movies > Expense:Entertainment:Travel > Expense:Entertainment:Hobbies > > I want a report of how much I spent on Expense:Entertainment overall for each > year. It shouldn't show me all the subaccounts, but their amounts shouldn't > be ignored. > > So if, for 2019, Expense:Entertainment had $100 and the other three > categories each had $50, it should show it as $250 for Expense:Entertainment > for the whole year. > > I can't seem to find a way to do this in Ledger. I've tried: > > ledger -Y reg "^Expense:Entertainment$" --period-sort "(amount)" > > But this gives just the amounts in Expense:Entertainment > > I also tried: > > ledger -Y reg ^Expense:Entertainment --depth 2 --period-sort "(amount)" > > This is a bit better, but it doesn't quite do it. In the first column it > shows only the amount for Expense:Entertainment. In the second column it has > all the subaccounts, but the problem is it is cumulative: > > 15-Jan-01 - 15-Dec-31 Expense:Entertainment 4.30 USD 402.92 > USD > 16-Jan-01 - 16-Dec-31 Expense:Entertainment 1233.76 USD 2687.10 > USD > 17-Jan-01 - 17-Dec-31 Expense:Entertainment 80.23 USD 2800.33 > USD > 18-Jan-01 - 18-Dec-31 Expense:Entertainment 9.89 USD 2949.82 > USD > > Also, just on the side - I noticed this command: > > ledger reg Expense:Entertainment --depth 2 --period yearly > > Gives slightly different values in the second column. Not sure why. > > The other problem with this is that it starts in 2015, when I have entries > prior to 2015 (but they appear only in subaccounts, and not the parent > Expense:Entertainment account). > > Any help would be appreciated. >
Greetings I do quite a bit of this. Sometimes I can have a very large number of sub accounts that all feed into one 'major' account. You have just used account 'names' where I added numbers (a LOT of numbers). Likely you've seen various 4 digit codes - - - - slightly different but both the USA and canuckistan use GIFI (IIRC general index of financial information) codes for business. I have extended that numbering scheme (adding more digits) so that I can do exactly what you are doing. Currently I have 20 different account numbers for 'entertainment'. So I'm a 'little' anal - - - - grin - - - but I can tell you have much money was used in each form of entertainment and then I have a query where the whole basket of stuff is accumulated. There may be a way of doing this when the 'accounts' are 'names' instead of numbers but the numbers are quite (the first 4 anyway) standardized for business so I wen t that way. For you to change your system would likely be some work but on the plain text program I'm working with there are search and replace functions (work well and are very easy) that might be one way of doing things - - - - ymmv! Further questions cheerfully entertained! Regards -- --- You received this message because you are subscribed to the Google Groups "Ledger" 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/ledger-cli/CAPpdf58zb0QMFBuGHe0J00WhEiAN2kqCvdioGv%3DFRFGak4c9mw%40mail.gmail.com.
