My wiki has several tiddlers tagged ‘article’. Each of these tiddlers have p0-date, p0-format, p1-date, p1-format fields. The dates refer to the date on which it was used and the formats refer to the format used on that date.
I want to draw up a list that looks like:
Title Date Format
Article1 2022-08-17 Text
Article2 2022-08-19 HTML
Article1 2022-08-21 HTML
Article2 2022-08-23 Text
Each article appears twice — once for p0-date and once for p1-date. When p0-date is used, po-format is used and similarly for p1-date. Also the list is sorted on the date — irrespective of whether it is p0-date or p1-date.
You can get the results of two filter run expressions to be appended without deduplication using the = run prefix. For instance, if the two runs have the same output, applying a :sort run at the end of the filter expression will co-locate the results, listing them twice each.
e.g. {{{ [!is[system]] =[!is[system]] :sort:string:casesensitive[{!!title}] }}}
In your case, I would use the <$list> widget instead of the filtered transclusion, and you will then need to build a table and use the <<currentTiddler>> variable to output the tiddler title, and other variables for the other information such as the date.
I am not exactly sure how you would do the secondary sort, but you may be able to get there with a nested list (a first level list to sort the titles, listing results only once, then a secondary list with a filter containing <currentTiddler> to output and sort the dates, storing the result into a different variable.) Alternatively, if you know there will only be two date fields, a simple filter expression within the first level list to test if p1-date is later than p0-date, handling both situations by assigning the correct dates to more generic first-date/second-date variables may get you there.
A useful reference for double sorting when the sort criteria are a field each http://doublesort.tiddlyspot.com/. Your case is more complex because the secondary sort criteria is a decision made from the values of two different fields.
What is we find the maximum length of the first field and pad each with spaces up to that length then concatenate the second field to the end? This would then I believe naturally sort.
n.b. the code assumes the following sequence of characters never appears in a tiddler title: ----- and there may be issues with sorting accurately because of the date format.