Finally found a reason to have a play with this one
Not sure how useful this will be for others, but @Jeff_Hager might find it of interest.
It accepts two joined lists, and will sort the values in the first list using the values in the second list as sort keys, and will return the sorted list as a single string with the delimiters stripped out.
I had a very specific use case for this, which was to transform a table like this:
It takes an optional delimiter as a 3rd parameter. In this case I used
|| in my joined lists as the source data (the dates) contains commas.