Hi, all --
I think I'm just not understanding this. I've been intrigued by the
"pivot" feature in Ledger since I first learned of it, but I've not been
able to make it work. After seeing Russell Adams simple presentation of it
earlier this week, I decided to try again tonight.
I can use Russell's simple example file and get the results that he got.
However, if I add another entry to it that doesn't include the relevant
categories, this entry is still included in the reports.
Here's Russell's sample file (renamed to test) with one additional entry:
--8<---------------cut here---------------start------------->8---
2011/11/01 Airplane ride
Source:VISA -$1000.00
Dest:Project
; ER: ER0001
; CATEGORY: Airfare
; PROJECT: Test
2011/11/02 Hotel overnight
Source:VISA -$200.00
Dest:Project
; ER: ER0001
; CATEGORY: Lodging
; PROJECT: Test
2011/11/03 Airplane ride
Source:VISA -$1500.00
Dest:Project
; ER: ER0002
; CATEGORY: Airfare
; PROJECT: Bob
2011/11/04 Hotel overnight
Source:VISA -$250.00
Dest:Project
; ER: ER0002
; CATEGORY: Lodging
; PROJECT: Bob
2011/11/05 Reimbursement
Source:VISA $1200.00
Dest:Project
; ER: ER0001
2011/11/07 Another entry
Source:Checking $1000.00
Dest:Other
--8<---------------cut here---------------end--------------->8---
Note that the last entry doesn't include any of the categories included in
the other entries. I would expect it not to show up in the reports. For
example,
ledger -f test -sEV bal --pivot CATEGORY
yields this:
$2950.00 CATEGORY
$2500.00 Airfare:Dest:Project
$450.00 Lodging:Dest:Project
$-2200.00 Dest
$-1000.00 Other
$-1200.00 Project
$-750.00 Source
$1000.00 Checking
$-1750.00 VISA
--------------------
0
and
ledger -f test -sEV bal --pivot ER
yields this:
$-1000.00 Dest:Other
$1750.00 ER
0 ER0001:Dest:Project
$1750.00 ER0002:Dest:Project
$-750.00 Source
$1000.00 Checking
$-1750.00 VISA
--------------------
0
In each case, the report includes the lines for "Dest:Other" and
"Checking." This is not a problem with such a simple file, but when I run
similar reports on my entire ledger file, I get what appears to be a line
for every account mentioned in the file. It's not helpful.
So I think I must be misunderstanding something. Clarity welcome.
Thanks.
--
John Rakestraw