At the hledger fan household, we modestly support a couple of yearly charity events. This year, as we decided to support the charities again, the question came up: How much did we give last year?
One great advantage of having recorded all our transactions over the last several years, is that the answer is easy to find. In Emacs ledger mode, for example, I can narrow the transaction to “donat” so that I will find transactions categorized either as “donation” or “donated.” Seeing just these transactions lets us quickly find the information we needed.
Even if I were using a different text editor from Emacs, one that didn’t have a narrowing or folding feature, I could accomplish much the same thing using the search feature. That is, search for “donat” in the file with your transactions, and you will find what you need.
I wouldn’t even need to use a text editor to search. The following hledger command works for showing my donations in my current.hledger file, which has my last 15 months of transactions:
hledger -f current.hledger areg donat
Once we have the amount of last year’s donation, we can then decide if we want to make any changes to our donation for this year.
Sort of. I will admit that looking at the number for last year is causing us to anchor on that figure. The important point is not how much we gave last year, but how worthy and effective the charity is and what our goals are for giving this year.
At least, though, we were able to quickly find the amounts of our previous year’s donation and make a similar contribution this year.