Question

Keep last edited record per route ID

  • 28 September 2018
  • 1 reply
  • 6 views

Badge

As the title suggest, I'd like to keep the last edited record per route. I've tried the statistics calculator (group by: route number) but it seems to keep all the records with a new 'max' field . Any recommendations?


1 reply

Badge +11

Hi @mariofederis,

Try using a Sorter transformer to sort by dates last edited, descending. Then use a Sampler transformer set to sample 1 feature, First N feature, grouped by the route number attribute. I was able to create a mock-up workspace, and for my very small sample data it worked well. Just make sure that the attribute that holds the last-edited-dates is recognized by FME as a datetime type so the Sorter knows what to do with it, I have that set in my reader. Here's a screenshot of my mockup workspace:

It may require some tweaking for your data, but hopefully it works out!

Reply