Hello
I am trying to understand how to construct a filter to select tiddlers based on the values in two fields.
<$list filter="[tag[tag1]get{!!field1}compare:number:eq{!!field2}]" variable=result1>
<<result1>>
There is at least one tiddler which is tagged tag1 and where field1 and field2 have the same value, but my filter does not find that tiddler.
What have I done incorrectly?
Cheers, Rob
Try using a :filter[...] filter run prefix
<$list filter="[tag[tag1]] :filter[{!!field1}compare:number:eq{!!field2}]" variable=result1>
<<result1>>
</$list>
Notes:
- The first filter run (
[tag[tag1]]) get a list of tiddler titles
- The second filter run (
:filter[...]) processes each title from the first filter run, and only retains titles that satisfy the comparison. Note that, within the :filter[...] filter run, the “currentTiddler” is set to each title in turn. This allows you to use {!!field1} and {!!field2} references.
enjoy,
-e