Skip to main content

Hi FME,

 

I have a dataset with date/time stamps where I need to retain only the first occurrence in each hour, on a given day.

 

For example:

 

1/1/2000 12:05 --> Keep

1/1/2000 12:10 --> Discard

1/2/2000 12:05 --> Keep

1/2/2000 12:15 --> Discard

1/2/2000 12:59 --> Discard

1/3/2000 12:00 --> Keep

1/3/2000 12:12 --> Discard

 

Thanks for taking a look!

Split the date/time step on the space.

Pass the results to a sampler, sample only the first feature, group by date.

This will sample only the first feature entering for each date.

Split_Date_Time


Update.

Your example doesn't show more than one hour per date, but your description does hint at that.

If you want something like

1/1/2000 12:05 --> Keep

1/1/2000 12:10 --> Discard

1/1/2000 13:05 --> Keep

1/1/2000 13:15 --> Discard

the solution presented above will not work.

In that case you can split on ':'


Reply