is this a bug?

42 views
Skip to first unread message

lipp f

unread,
Aug 30, 2022, 8:47:18 AM8/30/22
to Ledger
"ledger  reg" command is missing records at the end. I am running these on Aug 31. For acc1 the last  row is 2022-08-21 (2 weeks missing) and for  acc2 the last  row is  2022-07-03   (9 weeks missing). Is this a bug? Any workaround?

$ ledger -J -X USD -V -M --collapse reg acc1

2020-03-01 3.2250856547
2020-03-08 12.7704218218652774763
2020-03-15 26.18540631567
2020-03-22 36.3850603442
..........
2022-08-07 34043.6595879335223997432
2022-08-14 33566.2372724361028684014
2022-08-21 29085.177419898814
2022-08-21 29143.673327103207785134

$ ledger -J -X USD -V -M --collapse reg acc2

2020-09-06 -67.5034127105
2020-09-13 -88.70350586078
2020-09-20 -57.70738591814
2020-09-27 -44.918500714
.......
2022-06-26 5658.840091886942
2022-06-26 5676.8992906700606888
2022-07-03 6501.099703264095
2022-07-03 6587.0297032640949555

John Wiegley

unread,
Aug 30, 2022, 11:42:32 AM8/30/22
to lipp f, Ledger
>>>>> "lf" == lipp f <flip...@gmail.com> writes:

lf> "ledger reg" command is missing records at the end. I am running these on
lf> Aug 31. For acc1 the last row is 2022-08-21 (2 weeks missing) and for acc2
lf> the last row is 2022-07-03 (9 weeks missing). Is this a bug? Any
lf> workaround?

And you have transactions related to account acc1 in your file beyond
2022-08-21?

John

lipp f

unread,
Aug 30, 2022, 11:52:46 AM8/30/22
to Ledger
Those are investment / trading accounts and, although there are no always transactions for the last day, the value of the accounts  always change due to daily changes for prices of securities held. There are daily entries in the pricedb for all securities.

John Wiegley

unread,
Aug 30, 2022, 2:37:33 PM8/30/22
to lipp f, Ledger
>>>>> "lf" == lipp f <flip...@gmail.com> writes:

lf> Those are investment / trading accounts and, although there are no always
lf> transactions for the last day, the value of the accounts always change due
lf> to daily changes for prices of securities held. There are daily entries in
lf> the pricedb for all securities.

In that case you may want to add -G for the gain/loss report, since that
generates "daily positions adjustments" beyond the last entry in the ledger.

John

Lipp F.

unread,
Aug 30, 2022, 6:59:46 PM8/30/22
to lipp f, Ledger
Thanks John. I am wondering if you can be more specific. I have tried to add -G to "ledger reg" and it throws an error - "Error: Cannot add a sequence to an integer"

I am looking to get a list with account values, it could be either balance or gain, for a period of time. Is there any way to do that?

John Wiegley

unread,
Aug 31, 2022, 1:05:50 PM8/31/22
to Lipp F., Ledger
>>>>> "LF" == Lipp F <flip...@gmail.com> writes:

LF> Thanks John. I am wondering if you can be more specific. I have tried to
LF> add -G to "ledger reg" and it throws an error - "Error: Cannot add a
LF> sequence to an integer"

LF> I am looking to get a list with account values, it could be either balance
LF> or gain, for a period of time. Is there any way to do that?

Hmm... without knowing more about the data, I can't quite tell. But if you
build with debugging support enabled, and run with `--debug expr.calc`, it
should become clearer which two values it's trying to add that are not
compatible.

But other than the "revaluation" entries introduced by -G, Ledger does not
report entries for days where nothing happened. Maybe see if -E will give you
the empty entries you need for days with no change?

John
Reply all
Reply to author
Forward
0 new messages