Hi there, I am new to this forum, so I don't know whether I am right here. Anyhow, here is my question:
I just came across the --pivot feature and find it quite neat. I would like to use this feature to group account in different ways that would not be convenient to code into the account names. So here is one version that works for me with hledger 1.20.99
'''
2021-01-25 in
testA1 100 EUR ; class: A
input
2021-01-25 in
testA2 100 EUR ; class: A
input
2021-01-25 in
testB1 100 EUR ; class: B
input
2021-01-25 in
testB2 100 EUR ; class: B
input
'''
linux> hledger -f pivot1.ledger bal --pivot class
gives the desired result
-400 EUR
200 EUR A
200 EUR B
--------------------
0
But this requires to add 'class: A' and 'class: B' to every transaction. I would prefer if it were possible on an account basis. But I did not get this to work. Here is a failure example:
'''
account testA1 ; class: A
account testA2 ; class: A
account testB1 ; class: B
account testB2 ; class: B
2021-01-25 in
testA1 100 EUR
input
2021-01-25 in
testA2 100 EUR
input
2021-01-25 in
testB1 100 EUR
input
2021-01-25 in
testB2 100 EUR
input
'''
linux> hledger -f pivot1.ledger bal --pivot class
does not give the desired result
--------------------
0
I have played around with different variants of that, but without success. Anybody has a hint how to get this to work.
Laurenz.