Confused about syntax for automated transaction predicates

77 views
Skip to first unread message

Soren Bjornstad

unread,
Jun 23, 2019, 5:05:40 PM6/23/19
to Ledger
Hi all,

I've looked through the manual several times but never found a clear description of exactly what I can put in the predicate of an automated transaction. For instance, today I found that the following worked fine:

= /Income:Salary/ & (expr date >= [2019/04/26] && date < [2019/06/21]) & !tag(noauto)

But this didn't (it didn't match any transactions at all):

= /Income:Salary/ & (expr date >= [2019/04/26]) & (expr date < [2019/06/21]) & !tag(noauto)

I find this behavior totally nonsensical (each of the expressions work alone...so why not when ANDed together?), but suspect it is a side effect of not actually understanding what expression language is to be used here. Can someone point me to a clear explanation of all the possibilities?

Thanks!

John Wiegley

unread,
Jun 24, 2019, 6:00:31 PM6/24/19
to Soren Bjornstad, Ledger
>>>>> "SB" == Soren Bjornstad <soren.b...@gmail.com> writes:

SB> I find this behavior totally nonsensical (each of the expressions work
SB> alone...so why not when ANDed together?), but suspect it is a side effect
SB> of not actually understanding what expression language is to be used here.
SB> Can someone point me to a clear explanation of all the possibilities?

I'd never even considered using `expr` multiple times. In general I use:

= expr EXPR

Or just do simple query without `expr`.

John
Reply all
Reply to author
Forward
0 new messages