Yes. There are multiple ways of doing this. When I first started, I wanted
to have only one filter. Unfortunately, that wasn't possible. I ended up
with more list widgets than a simple nested list approach. BUT, you can now
add more levels of sorting without adding any more lists. So if you had 6
or 7 levels of sorting, it might be a useful approach. You could also wrap
with a macro with say 8 "level" markers to have a more universal solution.
On Friday, December 6, 2019 at 9:12:44 PM UTC-8, TonyM wrote:
>
> I do not mean to sound competitive, but all you need is .nested lists
>
> <$list fiter="[all[tiddlers]each[state]get[state]sort[]]" variable=state>
> <$list fiter="[all[tiddlers]state<state>each[region]get[region]sort[]]"
> variable=region>
> <$list fiter="[all[tiddlers]state<state>region<region>sort[]]">
> <<currentTiddler>>
> </$list>
> </$list>
> </$list>
> gives a list sorted by state then region then tiddler title
> not tested against data
>
> note the groups state and region use "each" and the inner list only lists
> those with the same state<state> and region<region> at a time
>
> to keep it tidy i use the same name as the field as the variable name
> generated by the each lists.
>
> state<state> means list all tiddlers with the state field = the value in
> the `<<state>> variable.
>
> you could wrap the whole thing or make it more levels deep however a new
> outer filter may need every filter to be updated. See how every list filter
> starts with all[tiddlers] a fresh, so if you want to operate on all
> tiddlers this is fine but only with tag[a] would need to read
> [all[tiddlers]tag[a] to each filter.
>
>
> Regards
> Tony
>
> On Saturday, December 7, 2019 at 3:47:14 PM UTC+11, Mark S. wrote:
>>
>>
>> There are different approaches. The easiest would be to make a button
>> that, when pressed, populates a fourth field that can then be sorted.
>>
>> Here's an approach that doesn't require two steps, but it does assume
>> that "@@" is reserved:
>>
>> \define sortus()
>> <$vars lb="[[" rb="]]">
>> <$list filter="[has[fa]]">
>> <$list
>> filter="[<currentTiddler>addprefix[@@]addprefix{!!fc}addprefix{!!fb}addprefix{!!fa}addprefix<lb>addsuffix<rb>]"/>
>> </$list>
>> </$vars>
>> \end
>>
>> <$wikify text=<<sortus>> name="ready2sort">
>> <$list filter="[enlist<ready2sort>sort[]]" variable="sorted">
>> <$list filter="[<sorted>split[@@]rest[]]"/>
>> </$list>
>> </$wikify>
>>
>>
>>
>>
>>
>>
>> On Friday, December 6, 2019 at 7:53:03 PM UTC-8, Mohammad wrote:
>>>
>>> Assume you have a bunch of tiddlers
>>>
>>> - all tagged with data
>>> - all have three fields fa, fb, fc
>>>
>>>
>>> How one can produce a list of tiddlers where they are
>>>
>>> - sorted first by fa
>>> - then by field fb
>>> - then by field fc
>>>
>>>
>>> This means to keep the multiple sort order!
>>>
>>> --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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/9b940a9e-ae92-499b-bd17-5c45f23daf87%40googlegroups.com.