A question of sort: Sort tiddlers by some calculated values

59 views
Skip to first unread message

Mohammad Rahmani

unread,
May 18, 2021, 8:18:44 AM5/18/21
to tiddl...@googlegroups.com
Assume you have filtered a list of tiddlers.

  1. For example you list all tiddlers tagged by student
  2. Each tiddler has two fields:  chemistry and math
  3. I want sort these tiddler by average value calculates as a = 0.5*(math+chemistry)

I am looking for one $list or one step listing!


Sidenote: I know I can calculate average and prefix to tiddler name (a-name) and then sort and display by removing prefixes.



Best wishes
Mohammad

Saq Imtiaz

unread,
May 18, 2021, 8:24:41 AM5/18/21
to TiddlyWiki
Use the sortsub operator, or in 5.1.24 the :sort run prefix

Mohammad Rahmani

unread,
May 18, 2021, 8:30:51 AM5/18/21
to tiddl...@googlegroups.com
Thank you Saq!
I will!

Best wishes
Mohammad


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/d1ee52f5-ea2a-4c93-a8ee-dca368ab4fd0n%40googlegroups.com.

Mohammad Rahmani

unread,
May 18, 2021, 11:34:31 AM5/18/21
to tiddl...@googlegroups.com
That is amazing Saq!

This is my solution and it works! This way we can write shorter and more clear codes!

<$vars vv-avgSubfilter="[{!!chemistry}] [{!!math}] +[average[]]">
  <$list filter="[tag[student]sortsub:number<vv-avgSubfilter>]">
    <$link/> - <$text text={{{[subfilter<vv-avgSubfilter>]}}} /><br>
  </$list>
</$vars>



Saq,
 I think it worth adding some more examples to official documentation!

Saq Imtiaz

unread,
May 18, 2021, 11:42:28 AM5/18/21
to TiddlyWiki
@Mohammad you know what I am going to say next ;)

Mohammad Rahmani

unread,
May 18, 2021, 1:00:12 PM5/18/21
to tiddl...@googlegroups.com
Got it;-)



Best wishes
Mohammad


--
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