I ended up writing a `in` filter operator, which can compare a field on the 
input tiddler to a TextReference to a list, and pass it through if it's in 
the list.  The code is here https://github.com/mklauber/tiddly-in-filter, 
and it's available in my plugin library 
here: https://mklauber.github.io/tw5-plugins/

Between that and the wikify macro to build up my filter runs, I was able to 
get things working.

On Tuesday, October 27, 2020 at 8:56:53 AM UTC-4 ma...@mklauber.com wrote:

> Here, I've placed my current dataset (D&D Creatures) and my attempts at to 
> achieve it in the attached file.  Thanks for taking a look.  I suspect that 
> with 5.1.23, I'll be able to use the `filter` operator to solve this 
> problem, but I'd love a backwards compatible option for people.
>
> On Tuesday, October 27, 2020 at 12:57:02 AM UTC-4 TW Tones wrote:
>
>> Matthew,
>>
>> I am sure I can help you but to do it from your last post is a little 
>> tricky. 
>>
>>    - Can you give a minimal case, perhaps that works on tiddlywiki.com
>>    - Doing this this I find I often find my own solution.
>>    - If anyone provides a solution on the minimal case you and other 
>>    readers will likely learn even more.
>>
>> Regards
>> Tones
>>
>> On Tuesday, 27 October 2020 03:43:00 UTC+11, Matthew Lauber wrote:
>>>
>>> Hey all, I'm trying to figure out how to handle an issue I've got coming 
>>> up.  
>>>
>>> I have a dataset I'm storing as tiddlers, with each field as a column.  
>>> I'm trying to implement filters on the dataset using <$select> widgets that 
>>> allow selecting multiple values.  I'm trying to create a filter that for 
>>> each tiddler in the dataset checks if `{{!!field}} is contained in 
>>> {{Selected!!field}}` i.e. is the tiddlers value in the allowed values.
>>>
>>> I figured out how to do this once, by flipping my filter around and 
>>> saying `[[Selected]contains:field{!!field}]`  But I can't use the `+` 
>>> symbol to AND these together, as the input is replaced instead of unioned 
>>> with the preceding filter.
>>>
>>> Does anyone know a better way to implement an `value IN list` filter, or 
>>> a better way to and things?  
>>>
>>> p.s. I'm trying to avoid multiple loops for ANDs, as I want to be able 
>>> to filter on arbitrary fields.  
>>>
>>> Thanks,
>>> Matt
>>>
>>

-- 
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/9fc51e96-8ee3-4336-8c2a-5e6c8e089339n%40googlegroups.com.

Reply via email to