Question

Aggregate datetime in range

  • 4 December 2018
  • 4 replies
  • 7 views

Badge +5

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

Userlevel 1
Badge +21

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

Badge +5

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?

Userlevel 1
Badge +21

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

Badge +5

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

Reply