Find tiddlers with field values greater than tagged tiddlers

Hi,

sorry for the title a bit incoherent, just didnt know how to phrase it:)

if i have TiddlerB that is tagged with TiddlerA , both have field1 , i want to know if TiddlerB holds a value that is greater than the field1 value of the tiddler it is tagged With(tiddlerA) , and bascially find all tiddlers that are like that, and in one filter

i tried the below , but it doesnt work, i just dont know how to refrence the field1 value of the tiddler i started with before doing tagging[] i tried {!!field1} ,but its now working

<$list filter="[all[]!is[system]tagging[]]:filter[get[field1]compare:number:gt{!!field1}]">

thank you

Are you saying?

For all tiddlers with tag “TiddlerA” (eg TiddlerB) find all tiddlers that have field1 greater than the current Tiddlers field1 (eg TiddlerB!!field1)

Perhaps you can store the value of TiddlerB!!field1 in a variable and compare that against the other tiddlers field1?

1 Like

@TW_Tones thanks tones .i can, but i was wondering if i can do the whole thing in one line?

I am not sure you can stick to one line when you need to find a list of tiddlers then itterate tags then make a comparison with the original tiddler.

If there is a way, I expect it would use multiple filter run prefixes and not very easy to read.

Using functions I Personaly try and divide the problem then write easy to read filters to get the final results.

  • more often than not the components are reusable elsewhere.
1 Like

@paulgilbert2000 this is a bit tricky to conceptualize without a set of test data but give this a try:

[has[field1]!is[system]] :filter[tags[]has[field1]get[field1]compare:number:lteq{!!field1}]

1 Like

@TW_Tones thank you , i was not sure too, but saqimtiaz’s solution work
@saqimtiaz Thank you , i guess using {!!} was correct, it was my filter logic that was probably flawed