problems for newby with --flat

46 views
Skip to first unread message

Richard Gott

unread,
Aug 21, 2018, 12:35:45 PM8/21/18
to Ledger
I started as treasurer for a charity a year ago - the first time I had done anything of the sort. I chose ledger because I prefer text based files - no regrets. At year end I ran some balance reports - all OK as usual.  Then I did a --flat balance report to export data to R.  And I got rubbish out.

The problems, as far as I can tell, is centred on the account structure.  I have, for eg, Income accounts that look like this:

Income:AA:BB  £99
Income:AA:BB:CC  £99
Income:AA:BB:CC  £99

An ordinary balance report is fine.  But a --flat balance gets confused over whether to add just the first of the lines above (depth 3) or the second and third (depth 4).  I can't remember which of them it did (the first I think) but it was, luckily, so far wrong that it couldn't be missed.

I suspect people are thinking 'what an idiot'.  It is blindingly obvious with hindsight that the first line must be treated as a 'dummy' account. Maybe there are instructions as to this problem in the manual, but if there are I idiotically missed them.

I had to manually edit the whole journal file, which serves me right I suppose.

However, I wonder if the manual ought to be more explicit as to the allowable  format for the account structure?

richard (tyro treasurer)

Martin Michlmayr

unread,
Aug 22, 2018, 5:17:49 AM8/22/18
to ledge...@googlegroups.com
* Richard Gott <richard....@gmail.com> [2018-08-21 09:35]:
> An ordinary balance report is fine. But a --flat balance gets confused
> over whether to add just the first of the lines above (depth 3) or the
> second and third (depth 4). I can't remember which of them it did (the
> first I think) but it was, luckily, so far wrong that it couldn't be missed.
>
> I suspect people are thinking 'what an idiot'.

No, several people have run into this issue, see e.g.
https://github.com/ledger/ledger/issues/1020
I'm not sure what the right behaviour should be with --flat.

--
Martin Michlmayr
https://www.cyrius.com/

Scott Carpenter

unread,
Aug 22, 2018, 7:26:41 PM8/22/18
to Ledger
Yep. I've been bit by this, too. I have a check and a warning in my ledgerbil grid helper when ledger's total doesn't match my grid total.

For a "newbie" you've done well to catch it and identify the issue. :-)

Richard Gott

unread,
Aug 23, 2018, 4:18:05 AM8/23/18
to ledge...@googlegroups.com
Thanks for link. I had searched but missed this one. Isn't the answer to document the use of dummy accounts, if that is the correct term?
Thanks
Richard
--

---
You received this message because you are subscribed to a topic in the Google Groups "Ledger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ledger-cli/jfF6NrZUa8k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ledger-cli+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
R Gott
1 Willow Court
Finghall
Leyburn
N Yorks

DL8 5NL

Scott Carpenter

unread,
Aug 23, 2018, 11:07:33 AM8/23/18
to Ledger
I don't think of it as a dummy account as much as usage of parent vs child accounts. It is probably a bug that should be fixed, but yes it may be helpful to document that assigning funds to both a parent and child account will produce unexpected results with --flat.

John Wiegley

unread,
Aug 23, 2018, 12:55:50 PM8/23/18
to Scott Carpenter, Ledger
>>>>> "SC" == Scott Carpenter <scarp...@gmail.com> writes:

SC> I don't think of it as a dummy account as much as usage of parent vs child
SC> accounts. It is probably a bug that should be fixed, but yes it may be
SC> helpful to document that assigning funds to both a parent and child
SC> account will produce unexpected results with --flat.

It also sounds like a bug to me, and a consequence of the fact that --flat
wasn't used much in the past.

John
Reply all
Reply to author
Forward
0 new messages