Skip to main content

Sorting happens mostly by one attribute across a set of features. I would like to sort multiple attribute values (all of type datetime) across one feature and pick out the most recent date (of that particular feature) and assign it to a new attribute. I can imagine a lot of complex Testers, but it seems so obvious to use sorting of some kind. Any suggestions?

Can you use a StatisticsCalculator and group by the attributes you want and look at the "highest" date?


How about a ListBuilder to combine your date attributes, then a ListSorter to get the newest/highest date to become list item {0} and finally a ListIndexer to pick out the date from list item {0} to a new attribute?


How about a ListBuilder to combine your date attributes, then a ListSorter to get the newest/highest date to become list item {0} and finally a ListIndexer to pick out the date from list item {0} to a new attribute?

That's a good solution that I use quite a lot, just be aware that the ListSorter cannot be used to sort on multiple keys, even when chaining multiple ListSorters, see: https://knowledge.safe.com/content/idea/72018/listsorter-to-support-multiple-sort-by-criteria.html

Also, I usually prefer using the Aggregator as it has more options than the ListBuilder, but of course that's a personal preference.


Hi @pimververgmail, if the dates are sortable format values (e.g. yyyymmdd etc.), you can populate them into a list and then extract min / max values with the ListRangeExtractor.

In order to populate the multiple attribute values into a list attribute, the ListPopulator or the ListExpressionPopulator could be used if the attributes are named with some specific convention, otherwise the AttributeListPopulator from FME Hub could be used.


Hi @pimververgmail, if the dates are sortable format values (e.g. yyyymmdd etc.), you can populate them into a list and then extract min / max values with the ListRangeExtractor.

In order to populate the multiple attribute values into a list attribute, the ListPopulator or the ListExpressionPopulator could be used if the attributes are named with some specific convention, otherwise the AttributeListPopulator from FME Hub could be used.

I tried the AttributeListPopulator, followed by the ListRangeExtractor. Worked like a charm! Thank you!


Reply