hledger icon indicating copy to clipboard operation
hledger copied to clipboard

query for all transaction made on date:Xxxdays

Open kiil opened this issue 3 years ago • 3 comments

As far as I can tell, there is currently no way to filter for all transactions made on, for example, mondays.

Something like

hledger reg date:'every monday in june'

or

hledger print date:'every monday in june'

to get a register of all transactions made on any monday in june, or to print them.

Or even

hledger bal date:'every monday in june'

To see how my balance would look like if I only made purchases on mondays.

every monday could perhaps also be shortened `mondays'.

Could also be something like

every weekday in june

and

every weekendday in june

to filter out spending on either weekends or weekdays.

And perhaps

'last weekday in every month'

to see if spending is bigger on paydays. (and to find salary payouts)

The use cases:

Discover spending patterns.

Find transactions you know was made on a particular weekday, but you don't remember which.

Quickly find salaries (for every month).

kiil avatar Aug 12 '22 16:08 kiil

https://hledger.org/1.26/hledger.html#query-types says date:'s argument is a period expression with no report interval. I think you are proposing to allow report intervals there. Related: https://hledger.org/1.26/hledger.html#periods-or-dates- .

Given current period expressions (https://hledger.org/1.26/hledger.html#period-expressions-with-a-report-interval) I think these could describe either a single day, all weekdays, or all weekenddays within each recurring period. If period expressions/report intervals get more expressive in future, date: would also.

simonmichael avatar Aug 12 '22 16:08 simonmichael

So would it be better with another flag than -p for this?

A flag where "every monday" actually means "every monday" - like it does when using forecasting or budgeting with ~.

kiil avatar Aug 12 '22 21:08 kiil

I might add that this functionality would also be useful for time budgets.

To compare how I spend my time on weekdays vs weekenddays (hopefully different)

kiil avatar Aug 13 '22 06:08 kiil