Skip to main content
Question

Aggregate datetime in range


djmcdermott
Contributor
Forum|alt.badge.img+6

Hi FME'ers,

 

I have a table containing weather forecast data every 3 hours over a 24 hour period. The time value is recorded in minutes past midnight, e.g. 180, 360, 540 etc. This table is updated at midnight and filtered to only records where the chance of precipitations is greater the 20%. I would like to aggregate these records where they occur consecutively with a start and end date

 

E.g. If rain is forecast for a continuous 9 hour then for 3 hours that would be aggregated into two record

Thanks,

4 replies

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • December 4, 2018

I would make use of the adjacent attribute feature in an attributecreator to create groupings, e.g. first value has group of zero, if the next attribute minute value is equal to the previous minute value plus 180 assign group zero, otherwise increment one to the group value. This grouping can then be used to aggregate


djmcdermott
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • December 4, 2018

Hi @egomm. Thank you for responding so quickly. I have had a play with the adjacent feature function and it looks promising. How do I handle incrementing the group value? Can you provide an screenshot?


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • December 4, 2018
djmcdermott wrote:

Hi @egomm. Thank you for responding so quickly. I have had a play with the adjacent feature function and it looks promising. How do I handle incrementing the group value? Can you provide an screenshot?

Not sure exactly what end result you are aiming for but this should give a demo of the adjacent feature function.

Incrementing is done with a conditional formula

rainfall.fmwt


djmcdermott
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • December 4, 2018
ebygomm wrote:

Not sure exactly what end result you are aiming for but this should give a demo of the adjacent feature function.

Incrementing is done with a conditional formula

rainfall.fmwt

Work great! Thank you


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings