Re: Query Help

2023-02-09 Thread Jasel17212
Thanks John!

On Wednesday, February 8, 2023 at 1:08:59 PM UTC-6 John Wiegley wrote:

> > "J" == Jasel17212  writes:
>
> J> I'm using zsh so entered:
>
> J> ledger reg ^exp and "(%tag1 | %tag2)" 
>
> Sadly, it has to be more separated than this:
>
>
> ledger reg ^exp and '(%tag1' '|' '%tag2)'
>
> It's a bug to me that the query parser interprets "(%tag1 | %tag2)"  as if 
> you
> had written "(%tag1 |" "%tag2)".
>
> John
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/62db2fbb-a89d-4e65-90fb-b8cd70b5cdabn%40googlegroups.com.


Re: Query Help

2023-02-08 Thread John Wiegley
> "J" == Jasel17212   writes:

J> I'm using zsh so entered:

J> ledger reg ^exp and "(%tag1 | %tag2)" 

Sadly, it has to be more separated than this:


  ledger reg ^exp and '(%tag1' '|' '%tag2)'

It's a bug to me that the query parser interprets "(%tag1 | %tag2)"  as if you
had written "(%tag1 |" "%tag2)".

John

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2o7q46kmi.fsf%40newartisans.com.


Re: Query Help

2023-02-07 Thread Randy Josleyn

On 2/8/23 06:18, Jasel17212 wrote:

Two questions:

Is there a shorthand way to write the following query?

ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr 
"has_meta('tag2')"


This seems to work for me:

ledger reg ^exp and expr "has_meta('tag1') | has_meta('tag2')"

Sorry I don't have an answer to the second question. —Randy

--

--- 
You received this message because you are subscribed to the Google Groups "Ledger" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/82c982c0-0f38-8e9c-1709-368f2b54ccea%40gmail.com.


Re: Query Help

2023-02-07 Thread Jasel17212
John,

I'm using zsh so entered:

ledger reg ^exp and "(%tag1 | %tag2)" 

The results were for tag2 only. 


I used the group-by tag as follows:

ledger reg ^exp and expr "(has_meta('tag1') or has_meta('tag2'))" 
--group-by tag('tag1')

The results was:

zsh: missing delimiter for 'u' glob qualifier


Thoughts on either result?
On Tuesday, February 7, 2023 at 6:08:28 PM UTC-6 jwie...@gmail.com wrote:

> > "J" == Jasel17212  writes:
>
> J> Is there a shorthand way to write the following query?
>
> J> ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr
> J> "has_meta('tag2')"
>
> You may need to escape it from your shell, but this should do it:
>
> ledger reg ^exp & (%tag1 | %tag2)
>
> J> ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr
> J> "has_meta('tag2')" --group-by 
>
> --group-by tag('tag1')
>
> John
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/b34b2681-74f9-4709-9a66-f32479a789bbn%40googlegroups.com.


Re: Query Help

2023-02-07 Thread John Wiegley
> "J" == Jasel17212   writes:

J> Is there a shorthand way to write the following query?

J> ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr
J> "has_meta('tag2')"

You may need to escape it from your shell, but this should do it:

ledger reg ^exp & (%tag1 | %tag2)

J> ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr
J> "has_meta('tag2')" --group-by 

--group-by tag('tag1')

John

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2edr1m32k.fsf%40newartisans.com.


Re: Query Help

2023-02-07 Thread federico lopez
On Tue, Feb 7, 2023 at 5:18 PM Jasel17212  wrote:

> Two questions:
>
> Is there a shorthand way to write the following query?
>
> ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr
> "has_meta('tag2')"
>
>
Hi JL,

Maybe just a little shorter:

reg ^exp and expr "(has_meta('tag1') or has_meta('tag2'))"

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/CAPYcn%3D4kruKiO6m1cwJsXSSj1aAd4Vzpges38K-ZitfLSUoESA%40mail.gmail.com.


Query Help

2023-02-07 Thread Jasel17212
Two questions:

Is there a shorthand way to write the following query?

ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr 
"has_meta('tag2')"

Is there a way to group the results of this query by tag?

ledger reg ^exp and expr "has_meta('tag1')" or ^exp and expr 
"has_meta('tag2')" --group-by 

Thanks
JL

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/717b2d79-9c33-4575-a457-aefba90efb6bn%40googlegroups.com.