Summable account balances

20 views
Skip to first unread message

Dan Sladden

unread,
Feb 22, 2021, 8:36:37 AMFeb 22
to Ledger
How to I produce a list of account balances without sub-accounts being aggregated up the tree?

From this:
2021-01-01 One
    Assets:One        $100
    Assets:Cash

2021-01-02 Two
    Assets:One:Two     $50
    Assets:Cash

I want a report like this:
               $-150  Assets:Cash
                $100  Assets:One
                 $50  Assets:One:Two
which nicely sums to zero (note the balance of Assets:One).

But with --flat --no-total I get this:
               $-150  Assets:Cash
                $150  Assets:One
                 $50  Assets:One:Two
which doesn't because the balance for Assets:One includes that of Assets:One:Two.

Thanks

Martin Michlmayr

unread,
Feb 22, 2021, 8:35:10 PMFeb 22
to ledge...@googlegroups.com
* Dan Sladden <dan.s...@gmail.com> [2021-02-22 05:36]:
> But with --flat --no-total I get this:
> $-150 Assets:Cash
> $150 Assets:One
> $50 Assets:One:Two
> which doesn't because the balance for Assets:One includes that of
> Assets:One:Two.

This is imho a bug in --flat. I ran into this recently and opened
this issue:
https://github.com/ledger/ledger/issues/1987

As a workaround, you could run multiple ledger bal commands
and combine the output into one file. You would run:
ledger bal ACCOUNT$
The $ indicating end of string, i.e. without subaccounts.

--
Martin Michlmayr
https://www.cyrius.com/
Reply all
Reply to author
Forward
0 new messages