Filter

132 views
Skip to first unread message

Peter Buyze

unread,
Apr 18, 2020, 4:53:31 AM4/18/20
to TiddlyWiki forum
I have tiddlers with a field that has text as a value. Some tiddlers have the same value.
Not being familiar with filtering and sorting yet, I would like a filter that picks up the values, sort them alphabetically, and below each value list the corresponding tiddler titles, which should also be listed alphabetically.


--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:

Mat

unread,
Apr 18, 2020, 7:32:14 AM4/18/20
to TiddlyWiki
Try this:

<$list filter="[all[tiddlers]has[fieldname]get[fieldname]sort[]]" variable=value >
__<
<value>>__<br>
<$list filter='[all[tiddlers]fieldname
<value>sort[]]'>

</$list>
</$list>

<:-)

Peter Buyze

unread,
Apr 18, 2020, 8:52:22 AM4/18/20
to TiddlyWiki forum
Mat,

it gives me a list, but if I have 3 tiddlers with value A, it lists that value 3 times, instead of once. Instead, under Value A in the list I would to see the 3 tiddlers listed, but right now there is none.

If I am not mistaken, in your macro I only have to add "A" twice": after the word "has" and after the word "get". Right?

--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:


18 Apr 2020, 14:32 by matia...@gmail.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+...@googlegroups.com.

Mat

unread,
Apr 18, 2020, 9:59:12 AM4/18/20
to TiddlyWiki
If I am not mistaken, in your macro I only have to add "A" twice": after the word "has" and after the word "get". Right?


I think there's some confusion in terminology. There are fields, referred to by their names, and there are the values of fields. When you say A, what are you referring to?

<:-)

Peter Buyze

unread,
Apr 18, 2020, 11:38:50 AM4/18/20
to TiddlyWiki forum
A = value of the field

--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:


18 Apr 2020, 16:59 by matia...@gmail.com:
If I am not mistaken, in your macro I only have to add "A" twice": after the word "has" and after the word "get". Right?


I think there's some confusion in terminology. There are fields, referred to by their names, and there are the values of fields. When you say A, what are you referring to?

<:-)


--
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+...@googlegroups.com.

Mat

unread,
Apr 18, 2020, 12:25:06 PM4/18/20
to TiddlyWiki
Peter Buyze wrote:
A = value of the field

In that case, when you in your question ask:

I would like a filter that picks up the values, sort them alphabetically, and below each value list the corresponding tiddler titles, which should also be listed alphabetically.

...what does "pick up the values, sort them alphabetically" refer to? The values are "A" so there's nothing to sort - ?

And if your reply is "well, the value can be A but it can also be anything else" then I must ask what is the common criteria that separates the relevant tiddlers from the non-relevant ones?

I'm guessing you don't want to list ALL values found in ALL fields in ALL tiddlers, right? What is the criteria to make it onto the list? (The most reasonable, for what you've asked so far, is that it only concerns those tiddlers that all have a particular field. In that case, what is that field name?)


<:-)

Peter Buyze

unread,
Apr 18, 2020, 1:20:38 PM4/18/20
to TiddlyWiki forum


...what does "pick up the values, sort them alphabetically" refer to? The values are "A" so there's nothing to sort - ?
A is text, it is a name. So each such field has 1 name and it varies between tiddlers.

And if your reply is "well, the value can be A but it can also be anything else" then I must ask what is the common criteria that separates the relevant tiddlers from the non-relevant ones?
All tiddlers are relevant.

Tiddler 1 has field value John
Tiddler 2 has field value Peter
Tiddler 3 has field value John
Tiddler 4 has field value Steven

What I want as output is:
John
  Tiddler 1 title
  Tiddler 3 title

Peter
  Tiddler 2 title

Steven
  Tiddler 4 title

Tiddler titles under each name are sorted alphabetically, and are clickable links.


I'm guessing you don't want to list ALL values found in ALL fields in ALL tiddlers, right? What is the criteria to make it onto the list? (The most reasonable, for what you've asked so far, is that it only concerns those tiddlers that all have a particular field. In that case, what is that field name?)


<:-)


--
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+...@googlegroups.com.

Mark S.

unread,
Apr 18, 2020, 1:24:04 PM4/18/20
to TiddlyWiki

I think you just need to add an "each" operator:

<$list filter="[all[tiddlers]has[fieldname]each[fieldname]get[fieldname]sort[]]" variable=value >
__<
<value>>__<br>

<$list filter='[all[tiddlers]
fieldname
<value>sort[]]'>

</$list>
</$list>


On Saturday, April 18, 2020 at 10:20:38 AM UTC-7, Peter Buyze wrote:


...what does "pick up the values, sort them alphabetically" refer to? The values are "A" so there's nothing to sort - ?
A is text, it is a name. So each such field has 1 name and it varies between tiddlers.

And if your reply is "well, the value can be A but it can also be anything else" then I must ask what is the common criteria that separates the relevant tiddlers from the non-relevant ones?
All tiddlers are relevant.

Tiddler 1 has field value John
Tiddler 2 has field value Peter
Tiddler 3 has field value John
Tiddler 4 has field value Steven

What I want as output is:
John
  Tiddler 1 title
  Tiddler 3 title

Peter
  Tiddler 2 title

Steven
  Tiddler 4 title

Tiddler titles under each name are sorted alphabetically, and are clickable links.


I'm guessing you don't want to list ALL values found in ALL fields in ALL tiddlers, right? What is the criteria to make it onto the list? (The most reasonable, for what you've asked so far, is that it only concerns those tiddlers that all have a particular field. In that case, what is that field name?)


<:-)


--
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+unsubscribe@googlegroups.com.

Mat

unread,
Apr 18, 2020, 2:15:27 PM4/18/20
to TiddlyWiki
Mark S. wrote:
I think you just need to add an "each" operator:

Yeah, but in addition Peters reply just informed (...or at least indicates) that the common denominator for the relevant tiddlers is a field called "name". 

Thus:

<$list filter="[all[tiddlers]has[name]each[name]get[name]sort[]]" variable=value >
__<
<value>>__<br>
<$list filter='[all[tiddlers]name
<value>sort[]]'>

</$list>
</$list>

Without the information that the common denominator is a field called "name" then the other option would be to list ALL values found in ALL tiddler fields that belong to ALL tiddlers. It seems very unlikely that you'd want this. 

<:-)

Peter Buyze

unread,
Apr 19, 2020, 12:31:14 AM4/19/20
to TiddlyWiki forum
Mat, I did not say there is a field called "name"; I said there is a field value that I type a name in, and that name varies from tiddler to tiddler, though some tiddlers have a name (i.e. field value) in common.

The name of the field is "swimmer" - I should have said that before. My apologies.

Like I said, your suggested macro resulted in a list of all the swimmers' names, except that if there are e.g. 3 tiddlers with swimmer's name John, your list results in John 3 times, whereas I just want John mentioned once with the 3 tiddler titles shown below his name.



18 Apr 2020, 21:15 by matia...@gmail.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+...@googlegroups.com.

Birthe C

unread,
Apr 19, 2020, 1:15:25 AM4/19/20
to TiddlyWiki
Peter,

I would be good if you uploaded you tiddlers when asking questions like this. Having to create lots of tiddlers with guessed fields and values to test a filter takes quite some time.

<$list filter="[all[tiddlers]each[swimmer]sort[swimmer]get[swimmer]]" variable=value >
__<
<value>>__<br>
<$list filter='[all[tiddlers]swimmer
<value>sort[]]'>

</$list>
</$list>

Birthe


Mat

unread,
Apr 19, 2020, 1:16:24 AM4/19/20
to TiddlyWiki
On Sunday, April 19, 2020 at 6:31:14 AM UTC+2, Peter Buyze wrote:
Mat, I did not say there is a field called "name"; I said there is a field value that I type a name in, and that name varies from tiddler to tiddler, though some tiddlers have a name (i.e. field value) in common.

The name of the field is "swimmer" - I should have said that before. My apologies.

Indeed, you should have.
 

Like I said, your suggested macro resulted in a list of all the swimmers' names, except that if there are e.g. 3 tiddlers with swimmer's name John, your list results in John 3 times, whereas I just want John mentioned once with the 3 tiddler titles shown below his name.

Yes it works as you can see in http://forpeter.tiddlyspot.com/ - the "Yes" is only listed once. If it were listed twice, that would mean that there is some difference between the multiple Yes'es.

<:-)

Mat

unread,
Apr 19, 2020, 1:48:09 AM4/19/20
to TiddlyWiki
Birthe C wrote:
Peter,

I would be good if you uploaded you tiddlers when asking questions like this. Having to create lots of tiddlers with guessed fields and values to test a filter takes quite some time.

To second what Birthe says, I also suggest that you from now on create (new) tiddlyspots for your questions. There is too much confusion caused by bits of information that you leave out. For a complex code like the one you're asking about, the one spending his/her time putting together an answer typically has to try it out which is quite an effort, only to be kind.

<:-)

Peter Buyze

unread,
Apr 19, 2020, 2:25:04 AM4/19/20
to TiddlyWiki forum
Thanks Birthe, that worked.

I will from now on upload tiddlers when asking questions like this.


19 Apr 2020, 08:15 by strikke...@gmail.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+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages