balance report comparing balance at two dates?

71 views
Skip to first unread message

Richard Lyons

unread,
Jan 12, 2015, 3:11:08 PM1/12/15
to ledge...@googlegroups.com
A conventional balance sheet shows the previous year's balance in a separate column. 
Being able to do this with a trial balance is also useful.  I have not found any way

to achieve this -- am I missing something obvious again?


TIA
richard

Craig Earls

unread,
Jan 12, 2015, 3:42:48 PM1/12/15
to ledge...@googlegroups.com
I do a similar thing by running ledger twice and combining the output in a shell script. The beauty of ledger is that the output is plain text so can be manipulated with scads of other tools. . 
--

---
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 ledger-cli+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

Alexis H

unread,
Jan 12, 2015, 5:29:16 PM1/12/15
to ledge...@googlegroups.com
Craig,
would mind to share your script or even add it to contrib/?

Cheers,
Alexis

--
Sent from mobile

Martin Blais

unread,
Jan 13, 2015, 12:04:21 AM1/13/15
to ledger-cli
I've been meaning to make a multi-year version of this for a while, I think it's a useful report. In Beancount you'd write a Python script, load the contents of the file, create two or more "realization" objects (like a mapping) and merge them into a single table therein; pretty straightforward.





--

Martin Blais

unread,
Jan 13, 2015, 12:06:24 AM1/13/15
to ledger-cli
Actually, more generally, it might be useful to write a utility script that merges together multiple text reports that have a leftmost column of account names, and anything on the right (balances or otherwise). This would be a text-only operation and would work with the entire Ledgerverse.

Martin Blais

unread,
Jan 13, 2015, 12:09:48 AM1/13/15
to ledger-cli
Ooooh that could even be implemented directly in BQL if bean-query supported JOINs and sub-selects, something like this:

       SELECT account, bal1, bal2 FROM
         (SELECT account, sum(cost(position)) as bal1 
          FROM CLOSE ON 2014-01-01 CLEAR) 
         JOIN
         (SELECT account, sum(cost(position)) as bal2 
          FROM CLOSE ON 2015-01-01 CLEAR) 
         ON account;



Alexis H

unread,
Jan 13, 2015, 1:29:46 AM1/13/15
to ledge...@googlegroups.com
Hello Martin,
maybe this could also be done using Ledger's Python module.

And have a look at Ledger's select command, it allows sql like queries on ledger journals, I know too little about it, since I don't use it (yet ;).

Richard Lyons

unread,
Jan 13, 2015, 3:49:59 AM1/13/15
to ledge...@googlegroups.com
Yes, please.  I would love to see that.  The main problem is that different
accounts may be absent in each of the two lists, so matching has to
interpolate both ways.

Cheers,
richard

Simon Michael

unread,
Jan 13, 2015, 10:30:30 AM1/13/15
to ledge...@googlegroups.com
Also have a look at hledger balance -D/-W/-M/-Q/-Y for ideas. It's the
report I use the most often by far.

http://hledger.org/manual.html#multi-balance-reports

Martin Blais

unread,
Jan 13, 2015, 2:10:24 PM1/13/15
to ledger-cli
Nice. 
It would be useful if you had example output in your doc.


Simon Michael

unread,
Jan 13, 2015, 2:16:11 PM1/13/15
to ledge...@googlegroups.com
Agreed 100%. I've postponed that throughout my docs to save time and
maintenance costs, and because it needs some interesting data. I need to
look at your realistic sample journal again.

Simon Michael

unread,
Jan 13, 2015, 2:20:07 PM1/13/15
to ledge...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages