Tinderbox Forum

Stop certain notes with certain attributes being gathered by an agent

I want to gather together all the notes I have where the prototype name begins with “Document” and then exclude from that set all notes which have and [user attribute1]>0 and also exclude all notes which have [useratribute2]>0.

Prototype.beginsWith("Document") | ([userattribute1]>0 & $[userattribute2]>0)

It doesn’t work. And there is no operator for NOT.

Help me please.

The not operator: !

Your query doesn’t quite match your description. It says:

  1. The name of the prototype begins with “Document”, OR
  2. Both userAttribute1 and userAttribute2 are greater than zero.

The square brackets [ ] in your query should be removed.

OK, our start is:

$Prototype.beginsWith("Document") | ($userattribute1>0 & $userattribute2>0)

But (my bolding):

But, you’ve used an ‘OR’ join after the first query term which doesn’t match your intent. IOW, you’ve used | (OR) not & (AND). So let’s fix that:

$Prototype.beginsWith("Document") & ($userattribute1>0 & $userattribute2>0)

Now to fix the last part.

So, assuming your userattribute1 and userattribute2 are both numbers with integer values we could use:

$Prototype.beginsWith("Document") & ($userattribute1!=0 & $userattribute2!=0)

But this does the same (assuming no negative values!):

$Prototype.beginsWith("Document") & ($userattribute1>0 & $userattribute2>0)

Whilst there is no SQL-like ‘NOT’ join, n’ot’ is data dependent and if you take a look through this part of aTbRef the per-type ‘not’ matches are described. I assume as database ‘NOT’ varies by addressed data type and—with less confidence—assume what that means by data type is documented (probably not). So, yes, Tinderbox lacks such an all-type wrapper for negative joins but it does provide the negative operators (and they are described).

. If you find otherwise, let me know. I’m always happy to plug gaps.

1 Like

Brilliant. Got it working. I am understanding better how the operators work. Once I master export …

1 Like