Trying to understand ledger bal

37 views
Skip to first unread message

Oliver Hardy

unread,
Apr 15, 2021, 9:25:39 AMApr 15
to Ledger
Having messed up my original ledger.dat file I am starting fresh and am immediately confused.

My ~/ledger.dat file so far:
Assets:Checking: $1,669.73
Liabilities:Credit_Card: $1,929.46
Equity:Opening Balance

2021/01/01 (#1004)
    Expenses:Rent                          $1,000.00
    Assets:Checking

2021/01/04 IRS
    Assets:Checking                          $600.00 ; stimulus check
    Income:Misc
~
Running ledger bal:
~$ledger bal
            $-400.00  Assets:Checking
           $1,000.00  Expenses:Rent
            $-600.00  Income:Misc
--------------------
If I have $1,669.73 in Checking, pay out $1,000.00 in rent and receive a $600.00 stimulus check which goes into Checking, shouldn't my checking balance be $1,629.73and not $400.00? I understand ledger is ignoring the Opening Balance but I don't know why.

Any help is appreciated.

Thanks - Arthur








Yuri Khan

unread,
Apr 15, 2021, 9:52:38 AMApr 15
to Ledger
On Thu, 15 Apr 2021 at 20:26, Oliver Hardy <ohar...@gmail.com> wrote:

> My ~/ledger.dat file so far:
> Assets:Checking: $1,669.73
> Liabilities:Credit_Card: $1,929.46
> Equity:Opening Balance
>
> 2021/01/01 (#1004)
> Expenses:Rent $1,000.00
> Assets:Checking
>
> 2021/01/04 IRS
> Assets:Checking $600.00 ; stimulus check
> Income:Misc
> ~
> Running ledger bal:
> ~$ledger bal
> $-400.00 Assets:Checking
> $1,000.00 Expenses:Rent
> $-600.00 Income:Misc
> --------------------
> If I have $1,669.73 in Checking, pay out $1,000.00 in rent and receive a $600.00 stimulus check which goes into Checking, shouldn't my checking balance be $1,629.73 and not $400.00? I understand ledger is ignoring the Opening Balance but I don't know why.

You don’t have an opening balance. You have three unintelligible lines
at the top, and then two valid transactions.

Format your opening balance as a transaction:

2020-12-31 Opening Balance

Martin Michlmayr

unread,
Apr 15, 2021, 9:53:51 AMApr 15
to ledge...@googlegroups.com
* Oliver Hardy <ohar...@gmail.com> [2021-04-15 06:25]:
> My ~/ledger.dat file so far:
> Assets:Checking: $1,669.73
> Liabilities:Credit_Card: $1,929.46
> Equity:Opening Balance

This is not valid syntax. Unfortunately ledger ignores invalid
syntax.

You want:

2021/01/01 * Opening balance
Assets:Checking $1,669.73
Liabilities:Credit_Card -$1,929.46
Equity:Opening Balance

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

Oliver Hardy

unread,
Apr 15, 2021, 10:37:42 AMApr 15
to Ledger
Martin:
2021/01/01 * Opening balance
Assets:Checking $1,669.73
Liabilities:Credit_Card -$1,929.46
Equity:Opening Balance

2021/01/01 (#1004)
    Expenses:Rent                          $1,000.00
    Assets:Checking

2021/01/04 IRS
    Assets:Checking                          $600.00
    Income:Misc

~$ledger bal
            $-400.00  Assets:Checking
           $1,000.00  Expenses:Rent
            $-600.00  Income:Misc
--------------------
What am I doing wrong?
Thank you










~

Martin Michlmayr

unread,
Apr 15, 2021, 10:50:46 AMApr 15
to ledge...@googlegroups.com
* Oliver Hardy <ohar...@gmail.com> [2021-04-15 07:37]:
> 2021/01/01 * Opening balance
> Assets:Checking $1,669.73
> Liabilities:Credit_Card -$1,929.46
> Equity:Opening Balance

Postings must have a space at the beginning:

2021/01/01 * Opening balance
Assets:Checking $1,669.73
Liabilities:Credit_Card -$1,929.46
Equity:Opening Balance

And account names and amounts need to be separated by either two
spaces (or more) or a tab (or more).

Oliver Hardy

unread,
Apr 15, 2021, 11:10:53 AMApr 15
to Ledger
Thank you, Martin and Yuri. I think I finally have it.
Much appreciated.

Arthur
Reply all
Reply to author
Forward
0 new messages