Skip to main content
Question

Keep last edited record per route ID

  • September 28, 2018
  • 1 reply
  • 49 views

Forum|alt.badge.img

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

jovitaatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • 635 replies
  • September 28, 2018

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!