To sort by multiple fields, you would use the sort filter run prefix 
<https://tiddlywiki.com/#Sort%20Filter%20Run%20Prefix>.(SFRP) Inside the 
SFRP, you would use a filter perhaps like:

```
:sort:string:caseinsensitive[[c_rank]addsuffix[tenure]addsuffix[birth_year]]
```

which would sort by rank, tenure, and birth year. You might need to 
zero-pad your fields.

To create the table, the easiest way is to use standard HTML notation. 



On Friday, April 15, 2022 at 2:09:56 PM UTC-7 Harry wrote:

> Hi,
>
> I have a question about sort a list by multiple fields. I have a bunch of 
> entries of persons' bios. Each bio entry has a set of fields associated, 
> such as birth year, death year, birth date, tenure length etc.
>
> I want to create a list with some of those persons and sort it by multiple 
> fields, such as first by tenure length, if same tenure, then sort by birth 
> year, then death year etc.
>
> What I currently have is 
>
> <$list filter="[c_status[incumbent]sort[c_rank]]">
> </$list>
>
> This gives me a list that allows me to filter all incumbents but the list 
> can only be sorted by rank. I want to add multiple fields (e.g. V1, V2, V3) 
> behind the rank sort but it doesn't work. I'd appreciate it if any one 
> could share their insights on this.
>
> My second, maybe more unrealistic goal, is to transform the list to a 
> table. Its visual would ideally look like this (
> https://en.wikipedia.org/wiki/Lists_of_state_leaders_by_age#Top_ten_since_1942),
>  
> i.e. I can put each field value of one entry in different cells of the same 
> row and the table will update itself
>
> The code I'm currently using is 
>
> <$list filter="[c_status[incumbent]sort[c_rank]]"> 
> <$link to=<<currentTiddler>>><$view field=birth_year/><$view 
> field=title/><$view field=birth_month/><$view field=c_rank/></$link><br> 
>
> And the layout is a list of sorted entries with field values crudely 
> attached at the beginning and the end of each line. Basically I wonder if I 
> can separate those values into different cells.
>
> Many thanks!
>
>

-- 
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/5595838a-ac78-4702-a6ec-92222a8d4bcbn%40googlegroups.com.

Reply via email to