Skip to main content
Question

How do I extract values every X seconds ?

  • October 28, 2019
  • 3 replies
  • 11 views

Hello,

I have a problem in FME. I have too much data so I want to filter data every 3 seconds (3 or 4 or anything, whatever) but I really don't know how to do it if someone can help me please .

 

Here is my fme workbench if that can help :

Here is an example of data (you can see that in date we have data every second and I want to put it in a "every 3 seconds format") :

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.

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+60
  • Celebrity
  • 3701 replies
  • October 28, 2019

It looks like you have 1 record per second, if that is the case you can simply use a Sampler with sampling rate set to however many seconds you want. A sampling rate of e.g. 3 will only pass through 1 of every 3 records.


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • October 28, 2019

I agree with @redgeographics, that if your data is consistent and continuous the Sampler (Every n features) is the way to go.

 

 

If it isn't then you can convert your date field to seconds (or other single unit) and calculate the modulo @fmod(time, interval) then test that the result is 0.

It looks like you have 1 record per second, if that is the case you can simply use a Sampler with sampling rate set to however many seconds you want. A sampling rate of e.g. 3 will only pass through 1 of every 3 records.

Thank you, it worked pretty well !