[tw5] Re: How to get the intersection of two lists in one filterexpression.

2020-07-28 Thread Saq Imtiaz

>
>  It is necessary to have this in one expression, because I need to define 
> an emptyMessage.
>

@Jan Do note that the emptyMessage can be as complex as you need it to be. 
Multiple lists, set widgets etc, all are possible. For legibility just 
assign it to a macro. 

-- 
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/2aa3e48e-5bac-4d0f-8147-44b650e2a38co%40googlegroups.com.


[tw5] Re: How to get the intersection of two lists in one filterexpression.

2020-07-27 Thread TW Tones
Jan,

By and intersection do you mean list only items in both lists?

If so surly the following form would work to obtain the intersection.
[run1] +[run2]

Which lists all titles in run1 and passes them through if they are also 
members of run2

I have also used the oposite remove the intersection of both sets.
[run1] -[run2]


I have used Bimlas's Kin filter to retrieve complex heirachies eg; whole 
toc (run1), and then remove a whole branch (run2)

Regards
Tony

On Tuesday, July 28, 2020 at 7:38:33 AM UTC+10, Jan wrote:
>
> Hi,
> I want to filter the intersection of two lists; something like 
> [list[!!actors]] *and* [subfilter] (xyz beeing also generated from a 
> listfield). It is necessary to have this in one expression, because I need 
> to define an emptyMessage.
> I does subfilter or the list always overwrite the existing result?
>
> Best Wishes and thanks for help
>  Jan
>
>

-- 
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/5e0842e6-5d53-4f6c-99e4-752f48ef7d01o%40googlegroups.com.


Re: [tw5] Re: How to get the intersection of two lists in one filterexpression.

2020-07-27 Thread Jan

Hi Mat.
Luckily I won't have any spaces in these fields.
Really quite a mind-eating operation that is necessary for this I was 
chewing on this for quite a while.

Thanks a lot!
Jan

Am 28.07.2020 um 01:46 schrieb Mat:

Mat wrote:

I gotta say I'm pretty proud over this one


...but some of the pride just faded as I realize it might not handle 
spaced titles so you'd have to do a little more tweaking to the titles 
and perhaps escaperegexp. But the general idea should be useable.


<:-)

--
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/bad17d4b-3ff3-4817-876e-866a349ef5cfo%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/5F1F6AD1.1040604%40googlemail.com.


[tw5] Re: How to get the intersection of two lists in one filterexpression.

2020-07-27 Thread Mat
Mat wrote:
>
> I gotta say I'm pretty proud over this one
>

...but some of the pride just faded as I realize it might not handle spaced 
titles so you'd have to do a little more tweaking to the titles and perhaps 
escaperegexp. But the general idea should be useable.

<:-)

-- 
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/bad17d4b-3ff3-4817-876e-866a349ef5cfo%40googlegroups.com.


[tw5] Re: How to get the intersection of two lists in one filterexpression.

2020-07-27 Thread Mat
I was mentally preparing for a similar problem so I picked up your 
challenge and... I gotta say I'm pretty proud over this one:

<$set name="b" filter="""[enlist{!!list-b}split[ 
]join[|]addprefix[(?=]addsuffix[)]]""" >
<$list filter="[enlist{!!list-a}regexp]" emptyMessage="NO intersection">




<:-)

-- 
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/6f85a615-9218-4bc5-855b-a12b77a47d2co%40googlegroups.com.