Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More powerful expr: queries ? #2095

Open
simonmichael opened this issue Oct 5, 2023 · 2 comments
Open

More powerful expr: queries ? #2095

simonmichael opened this issue Oct 5, 2023 · 2 comments
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. needs:design To unblock: needs more thought/planning, leading to a spec/plan needs:mockup/screenshot To unblock: needs a rough mockup, eg in plain text, or a screenshot queries Filtering options, query arguments..

Comments

@simonmichael
Copy link
Owner

simonmichael commented Oct 5, 2023

We added the more expressive "expr:" queries recently, but they don't give as much extra power as you'd think; eg they don't let us select whole transactions by the amount posted to a particular account (real world example). Eg it would be nice to be able to print whole transactions which post between $100 and $200 to assets:foo.

@simonmichael simonmichael added A-WISH Some kind of improvement request, hare-brained proposal, or plea. queries Filtering options, query arguments.. needs:design To unblock: needs more thought/planning, leading to a spec/plan needs:mockup/screenshot To unblock: needs a rough mockup, eg in plain text, or a screenshot labels Oct 5, 2023
@simonmichael
Copy link
Owner Author

@simonmichael
Copy link
Owner Author

B> I'm looking for a way to find transactions which are pending at a given time, i.e. given a point in time T, have postings with posting dates both before and after T. Is there a builtin way to do this with hledger?

B> Would there be interest in adding such a feature? One idea I had is to have a filter that matches on posting date, which could be used to implement this easily by using something like pdate:..T and pdate:T..

S> which posting(s) would that match ?

B> I would assume it matches transactions with both a posting with date before T and a posting with date after T (since for print, the filter AND composition is on transaction level)

B> but I see that this could be too complex to understand, so perhaps for now I'll just use a custom haskell script adapted to my usecase

S> I see, so that would be "(any posting dated <T) and (any posting dated >=T)"

S> a general way to apply queries to any/all postings within transactions seems possibly useful, also

S> expr:"any:date:..T and any:date:T.."

S> starts to get a bit complex indeed, and IME such things are not needed often in practice, but would be interesting to try

S> it's more justifiable if it's general and composable - not just adding another few special cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. needs:design To unblock: needs more thought/planning, leading to a spec/plan needs:mockup/screenshot To unblock: needs a rough mockup, eg in plain text, or a screenshot queries Filtering options, query arguments..
Projects
None yet
Development

No branches or pull requests

1 participant