Idea SubSort parameter on sort operator

47 views
Skip to first unread message

TonyM

unread,
Mar 31, 2020, 12:05:53 AM3/31/20
to TiddlyWikiDev
Folks,

I am working on a report generator and realised I may like to sort on more than one parameter eg state then region

I konw how to do as much with nested lists but what if the sort operator supported it?

I am not so sure if it would be difficult or not to implement but It may look like this

sourcelist +[sort{!!state}] +[sort:subsort{!!region}]
Or another form of annotation

The idea would be to first sort the list by state, then within Each" value of state sort it by region

Ideally we could then sort again N times, here I use a subsort operator so we are free to provide some flags
sourcelist +[sort{!!state}] +[subsort{!!region}] +[subsort[title]]
or a flag could be used on each of the sort types eg +[nsort:subsort<var>]


Why?
  • Tiddlywiki is about lists, and sorting an important feature. 
  • Filters are our title handlers and are used to generate lists
  • There have being calls for intermediate values in filters but perhaps one reason is to group and subgroup rather than use multiple list widgets.
  • Filters acting on lists are not dissimilar to 4th Generation report languages,
    most have the ability to group in the listing mechanism.
Thanks for your consideration

Regards
Tony



Jeremy Ruston

unread,
Mar 31, 2020, 7:00:45 AM3/31/20
to tiddly...@googlegroups.com
Hi Tony

Could the same thing be achieved by extending the sort operator to accept a list of field names, for example:

[all[tiddlers]sort[state,region,title]]

Best wishes

Jeremy.

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/0d08d142-76de-4208-a78c-78f31a080530%40googlegroups.com.

TonyM

unread,
Mar 31, 2020, 11:34:58 PM3/31/20
to TiddlyWikiDev
Jeremy

That would be a very good start because it would support many use cases and worth while in its own right.

However is it possible to support reverse sorts for one field and not the other?. Which is common with numbers date and time.

I have started thinking tools to push results into Json lists on which complex sorts and filters may be subsequently applied may be a more sophisticated approach but this forces the need for a trigger.

Regards
Tony

Reply all
Reply to author
Forward
0 new messages