Hi Damon

We now have a compare operator in the core that can do "less than" comparisons 
on numbers, dates and strings:

https://tiddlywiki.com/#compare%20Operator

Best wishes

Jeremy

--
Jeremy Ruston
jer...@jermolene.com
https://jermolene.com

> On 29 Nov 2020, at 19:14, History Buff <damon.pritch...@gmail.com> wrote:
> 
> Joshua,
> 
> I stumbled on this thread today while searching for "less than" in this 
> group. Your compare fields filter is exactly what I was looking for! Thanks 
> so much. It works amazingly.
> 
> Damon
> 
>> On Wednesday, September 30, 2020 at 4:03:09 PM UTC-7 joshua....@gmail.com 
>> wrote:
>> The core "compare[X]" operator only compare each "input title" to the 
>> operand (i.e. X). It has options to compare strings, numbers, equal to, 
>> greater than, etc.... BUT the limitation of only comparing input-title means 
>> you would have to use "get[]" or similar to retrieve the data, thus losing 
>> the "title" during the filter-processing.
>> 
>> I don't think "subfilter[]" will help here, because the compare[] op, as I 
>> said, returns the data that passes the compare-function given, NOT the title.
>> 
>> So I rolled my own. It is included in the JSONMangler plugin, but can be 
>> pulled into any wiki if you go to the plugin-contents tab, and drag the 
>> filter you want to your own wiki:
>> 
>> http://chronicles.wiki/TW5-JsonMangler/#%24%3A%2Fplugins%2Fjoshuafontany%2Fjsonmangler
>> 
>> You will want to drag and drop the
>> $:/plugins/joshuafontany/jsonmangler/modules/filters/comparefield.js
>>  link in the contents tab.
>> 
>> Best,
>> 
>> Joshua Fontany
>> 
>>> On Wednesday, September 30, 2020 at 1:34:39 PM UTC-7 scarab...@gmail.com 
>>> wrote:
>>> I'm looking for a way to get tiddlers based on comparing integer fields 
>>> existing in them. This filter works:
>>> 
>>> [myfieldOne[2]myfieldTwo[2]]
>>> 
>>> I'd like something like:
>>> 
>>> [myfieldOne[lteq[2]]myfieldTwo[lteq[2]]]  
>>> 
>>> I know there are compare operators 
>>> (https://tiddlywiki.com/#compare%20Operator), but I haven't figured out how 
>>> to use it to filter the lists. Would this require a subfilter? If so, how 
>>> would that look? 
>>> 
>>> Thanks!
>>> Sean
>>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/5820178b-d886-4c70-9c05-b44a4f9d0868n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/E9085145-120E-4319-BE14-189DCA73F711%40gmail.com.

Reply via email to