Discussion:
--pivot failing on large file
Brandon Olivares
2018-08-07 02:51:24 UTC
Permalink
Hello,

I have a large journal file of 36 KB. And it seems that certain --pivot queries are failing.

My query looks like this:

hledger balance Expenses --pivot johnstown-trip

The johnstown-trip tag was a tag applied to several of my transactions in early July.

The above query returns my entire balance, like this:

$ hledger balance Expenses --pivot johnstown-trip
$5,496.87
--------------------
$5,496.87

That's the same number if I just use hledger balance, not the total of that tag at all.

The following query works:

$ hledger balance Expenses tag:johnstown-trip
$377.46 Expenses:Vacation
--------------------
$377.46

Here's a sample transaction with the tag:

2018/07/02 * Red Lobster ; johnstown-trip:
Expenses:Vacation $95.00 ; envelope: Restaurants
Assets:Cash:Discover:Checking $-95.00

So the tag is definitely being registered, but --pivot isn't returning the correct value.

Should I file this as a bug, or am I doing something wrong?
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert Nielsen
2018-08-10 01:47:42 UTC
Permalink
I am not sure what is happening. I took your example transaction, created a
new file, added an opening balance, and pasted multiple copies of the
example transaction until the file was well over 1 million lines long. Then
I ran the two commands mentioned below, and in my test the totals were the
same:

hledger -f test.hledger balance Expenses tag:johnstown-trip

$33381480.00 Expenses:Vacation

--------------------

$33381480.00

hledger -f test.hledger balance Expenses --pivot johnstown-trip

$33381480.00

--------------------

$33381480.00


First, though, it occurs to me that I may have missed what you meant, so
please let me know if that's the case.


Rob
Post by Brandon Olivares
Hello,
I have a large journal file of 36 KB. And it seems that certain --pivot
queries are failing.
hledger balance Expenses --pivot johnstown-trip
The johnstown-trip tag was a tag applied to several of my transactions in early July.
$ hledger balance Expenses --pivot johnstown-trip
$5,496.87
--------------------
$5,496.87
That's the same number if I just use hledger balance, not the total of that tag at all.
$ hledger balance Expenses tag:johnstown-trip
$377.46 Expenses:Vacation
--------------------
$377.46
Expenses:Vacation $95.00 ; envelope: Restaurants
Assets:Cash:Discover:Checking $-95.00
So the tag is definitely being registered, but --pivot isn't returning the correct value.
Should I file this as a bug, or am I doing something wrong?
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Michael
2018-08-16 11:00:15 UTC
Permalink
Post by Brandon Olivares
Hello,
I have a large journal file of 36 KB. And it seems that certain --pivot queries are failing.
hledger balance Expenses --pivot johnstown-trip
The johnstown-trip tag was a tag applied to several of my transactions in early July.
$ hledger balance Expenses --pivot johnstown-trip
$5,496.87
--------------------
$5,496.87
That's the same number if I just use hledger balance, not the total of that tag at all.
$ hledger balance Expenses tag:johnstown-trip
$377.46 Expenses:Vacation
--------------------
$377.46
Expenses:Vacation $95.00 ; envelope: Restaurants
Assets:Cash:Discover:Checking $-95.00
So the tag is definitely being registered, but --pivot isn't returning the correct value.
Should I file this as a bug, or am I doing something wrong?
Hopefully it's the latter. Make a copy of your files and shrink/simplify them until the problem goes away.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...