I'm preparing reports for my accountant and I have found what looks like a limitation of hledger. I'm interested in knowing:
Am I using hledger incorrectly?
If this is a limitation of hledger, is it intentional?
If this feature is desired, how much effort would it be?
I have a tree of Expense accounts and the postings in those accounts are labeled with a significant tag. Now I want to combine the beauty of --pivot on balance amounts per tag value with the beauty of --tree in order to get both the balances per tag value of each subaccount and the rolled-up balance per tag value.
Based on what I've tried so far, if I use --pivot, then --tree appears to have no effect.
I get a balance report per rental_unit value, but only for the root account and not the subaccounts.
Workaround
I know that I can list the subaccounts, then run the --pivot report for each subaccount. I'm wondering whether I'm missing something, and if not whether this is intentional, and if not whether what I'm trying to do is something that hledger could feasibly support.
No, the problem was that there are effectively two trees: one consisting of subaccounts of Expenses:Residential Rental Properties and the other consisting of the values of the tag rental_unit. As far as I can tell, that means a Morton's Fork.
pivot on rental_unit, but then I can't see the subaccount balances per rental unit, but rather only the total in Residential Rental Properties.
tree on Expenses:Residential Rental Properties, but then I can't see the amounts by rental unit, but rather only the total balance in each subaccount for all rental units.
It makes perfect sense that hledger would behave like this, because the resulting report is a forest and not a tree, but I was hoping I had missed some magic somewhere.
An example to make it more concrete:
Expenses
Residential Rental Properties
Management Fees
Ordinary Repairs
Electricity
Could I get a tree-style report showing the balance in each of those three subaccounts as well as the parent accounts also pivoted by rental unit tag value in a single command? I know that I could iterate over either the subaccount names or the rental unit tag values.