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

Query any of matching amounts #665

Open
varac opened this Issue Dec 3, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@varac

varac commented Dec 3, 2017

Hi,

maybe I don't fully understand the query syntax (more example in the manpage would be highly appreciated), but how can I query for any of two specified amounts ?

hledger reg amt:20.00 amt:10.00

shows nothing at all, while single searches for each amount do show some transactions.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Dec 3, 2017

Owner

That's a good question. It's not so easy, because we haven't got around to implementing full boolean query expressions. As the "queries" doc says, like query terms are AND'd together.

Some possible workarounds, meanwhile:

(hledger print amt:20; hledger print amt:10) | hledger -f- reg    # (bash syntax)
hledger reg amt:'>=10' amt:'<=20'
(hledger print amt:20; hledger print amt:10) | hledger reg amt:'>=10' amt:'<=20'
Owner

simonmichael commented Dec 3, 2017

That's a good question. It's not so easy, because we haven't got around to implementing full boolean query expressions. As the "queries" doc says, like query terms are AND'd together.

Some possible workarounds, meanwhile:

(hledger print amt:20; hledger print amt:10) | hledger -f- reg    # (bash syntax)
hledger reg amt:'>=10' amt:'<=20'
(hledger print amt:20; hledger print amt:10) | hledger reg amt:'>=10' amt:'<=20'
@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Dec 3, 2017

Owner

(Actually it doesn't say that. Here's what it says.)

Owner

simonmichael commented Dec 3, 2017

(Actually it doesn't say that. Here's what it says.)

@varac

This comment has been minimized.

Show comment
Hide comment
@varac

varac Dec 3, 2017

Is there an issue for implementing full boolean query expressions that I could subcribe to ? Is this on the roadmap ?

varac commented Dec 3, 2017

Is there an issue for implementing full boolean query expressions that I could subcribe to ? Is this on the roadmap ?

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Dec 3, 2017

Owner

#203 is the one I found just now. This is a feature we'd like to have, and shouldn't be too hard.

Owner

simonmichael commented Dec 3, 2017

#203 is the one I found just now. This is a feature we'd like to have, and shouldn't be too hard.

@ony

This comment has been minimized.

Show comment
Hide comment
@ony

ony Dec 4, 2017

Collaborator

@simonmichael currently accounts being OR-ed together and not:... being AND-ed. It might make sense have something similar for amt:... as well where precise values are added to query with OR semantic while half-ranges with AND.
I would definitely like to have complete query language that allows me to find any transaction (maybe SQL-like with grouping). But I suspect that this feature will be underused by most people.
Even hledger reg amt:20.00 amt:10.00

Collaborator

ony commented Dec 4, 2017

@simonmichael currently accounts being OR-ed together and not:... being AND-ed. It might make sense have something similar for amt:... as well where precise values are added to query with OR semantic while half-ranges with AND.
I would definitely like to have complete query language that allows me to find any transaction (maybe SQL-like with grouping). But I suspect that this feature will be underused by most people.
Even hledger reg amt:20.00 amt:10.00

@simonmichael simonmichael added the A WISH label Dec 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment