[TW5] How to make [list[!!mylistfield]] not delete duplicated values?

67 views
Skip to first unread message

sini-Kit

unread,
Dec 1, 2017, 4:10:21 AM12/1/17
to TiddlyWiki
Hi!

I have NewTiddler with field mylistfield contains some values "1000 1000 2000 3000 4000"
 when I use
<$list filter="[list[!!mylistfield]nth[2]]"/>
I get the result 2000 (so my filter remove one 1000 value)
I want my filter not remove duplicated values, and I want to get result 1000

is it possible?

TonyM

unread,
Dec 1, 2017, 8:07:28 AM12/1/17
to tiddl...@googlegroups.com
Edit of otherwise dud message

The removal of duplicates from title lists is a fundamental requirement of most filter combinations if you stop to think about it, say I want a list of items tagged a and B then I do not want to see those tagged both a and b twice.

they are after all considered title lists, even although we do try and redeploy filters in many ways.

I agree we need such a features because the logic of the world does not always comply, however can you try a slightly different architecture to the one you are using?, 

Perhaps instead of a field treated as titles use a data tiddler and have a index to each of the elements, in this case element 2 will always be element 2.

Data tiddlers are more like a database and filters spend a lot of time being about titles, I would be concerned if a filter feature resulted in making such title handling more complex. In your use case I thing data tiddlers would be a more robust representation of what you are doing anyway.

The "PR ( #2963) to add that capability. It was ready two releases ago." that Mark mentions may be held back because of this fundamental nature. 

Regards
Tony

sini-Kit

unread,
Dec 1, 2017, 8:59:17 AM12/1/17
to TiddlyWiki
I have found old split plugin. And it works

{{{[split:mylistfield[ ]nth[2]]}}}

Filter operator for splitting each current list element
into several new elements.


but may be it is possible to get the same result using standard tiddlywiki filters?



пятница, 1 декабря 2017 г., 16:07:28 UTC+3 пользователь TonyM написал:
The removal

Mark S.

unread,
Dec 1, 2017, 9:19:45 AM12/1/17
to TiddlyWiki
There's a PR ( #2963) to add that capability. It was ready two releases ago.
Reply all
Reply to author
Forward
0 new messages