value expressions and tags

79 views
Skip to first unread message

Thomas Bikeev

unread,
May 13, 2010, 6:58:21 PM5/13/10
to Ledger
Hello John,

can I use tags in value expressions? I'm trying to set an automated
transaction that would select only "tagged" entries.

Cheers, Thomas

Peter Ross

unread,
May 13, 2010, 7:42:12 PM5/13/10
to ledge...@googlegroups.com
On Fri, May 14, 2010 at 8:58 AM, Thomas Bikeev <thomas...@gmail.com> wrote:
> Hello John,
>
> can I use tags in value expressions? I'm trying to set an automated
> transaction that would select only "tagged" entries.
>
Here is how I automatically deduct GST (VAT in the rest of the world)
from any expenses which are tagged :gst:

= tag gst and /^Expenses/
$account -0.090909091
Liabilities:BAS:GST:GST Paid 0.090909091

Thomas Bikeev

unread,
May 13, 2010, 7:47:09 PM5/13/10
to Ledger
Hi Peter,

brilliant - many thanks!

On May 14, 1:42 am, Peter Ross <pe...@emailross.com> wrote:

John Wiegley

unread,
May 13, 2010, 8:15:53 PM5/13/10
to ledge...@googlegroups.com
On May 13, 2010, at 7:42 PM, Peter Ross wrote:

>> can I use tags in value expressions? I'm trying to set an automated
>> transaction that would select only "tagged" entries.
>>
> Here is how I automatically deduct GST (VAT in the rest of the world)
> from any expenses which are tagged :gst:
>
> = tag gst and /^Expenses/
> $account -0.090909091
> Liabilities:BAS:GST:GST Paid 0.090909091

Yes, automated expressions nowadays use report query syntax, not value expression syntax. This is both more compatible with 2.x, and also easier for simpler queries like above. Use the 'expr' keyword to introduce a real value expression in these cases:

= expr tag(/gst/) and expr account=~/^Expenses/

At least, that's how it's meant to work. :)

John
Reply all
Reply to author
Forward
0 new messages