Skip to main content
Released

ListSorter to support multiple sort-by criteria

Related products:Transformers
  • Jun 8, 2018 12:00 AM UTC
  • 10 replies
  • 157 views

david_r
Celebrity

I would like the ListSorter to support multiple sort-by criteria, similar to the regular Sorter. Example:

Currently (FME 2018.0.1) you cannot use multiple ListSorters to accomplish the same thing, since the ListSorter doesn't preserve the existing item order on duplicate sort keys (PR83992).

10 replies

Forum|alt.badge.img
  • Feb 21, 2019 8:36 AM UTC

Hi David,

Is it a list you have built (e.g. with an Aggregator) ? I have this case, and this is the way I proceed. I have to sort my datas by priority (attribute PRIORITE) then by date (attribute DATE).

I use a Sorter with these two criterias BEFORE the Aggregator so my datas are already sorted after the Aggregator.

Is it what you want to do ? But I have to admit that a mutiple sort-criteria would be great !

Best regard

Patrick


david_r
Celebrity
  • Author
  • Feb 21, 2019 8:51 AM UTC

Sorting the data before list generation isn't always feasible, unfortunately, as the input sort order isn't always guaranteed on the output list. You may also want to sort by an attribute that was introduced by the transformer generating the list, e.g. the NeighborFinder.


tomw202
Contributor
Forum|alt.badge.img+4
  • Contributor
  • Dec 18, 2019 1:51 PM UTC

This would be really useful!


chriswilson
Enthusiast
Forum|alt.badge.img+29
  • Enthusiast
  • Jan 7, 2020 10:15 PM UTC

I'd say this is a no-brainer, it would be great to have the option to examine the list in this way without having to explode and then sort on a secondary attribute.


david_r
Celebrity
  • Author
  • Jan 8, 2020 8:56 AM UTC

Hopefully someone with the "power of the purse" at Safe will agree soon as well ;-)


jdh
Contributor
Forum|alt.badge.img+41
  • Contributor
  • Sep 29, 2023 5:34 PM UTC

As far as I can tell, if you chain a set of ListSorters in order of increasing priority you get the correct results.

ie. if you want to sort on attribute A then B you would have two listSorters, the first on B and the 2nd on A.

I haven't tried this with 3 or more, and it would be much nicer if we could have the same functionality as the sorter, where we just add as many criteria as we need.


LizAtSafe
Safer
Forum|alt.badge.img+26
  • Safer
  • Apr 6, 2026 10:56 PM UTC
Open→Gathering Interest

LizAtSafe
Safer
Forum|alt.badge.img+26
  • Safer
  • Aug 17, 2026 5:47 PM UTC
Gathering Interest→In Development

LizAtSafe
Safer
Forum|alt.badge.img+26
  • Safer
  • Sep 15, 2026 7:57 PM UTC
In Development→Released

ebygomm
Evangelist
Forum|alt.badge.img+54
  • Evangelist
  • Sep 16, 2026 9:26 AM UTC

I wonder what the oldest idea to be Released is….