Skip to main content

Hello everyone,

 

I try to automate a monthly calculation of water deficit, based on monthly rainfall data. Each feature is characterized by a year (integer), a month (integer), and rainfalls (float).

 

The calculation involves the water reserve at the end of each month ("final reserve"), based on rainfalls and number of rainy days.

 

My challenge is that I need to carry this quantity to the next month ("former reserve" of current month = "final reserve" of previous month). Easy to do in Excel, but I'm not sure if this is possible and how I should proceed in FME.

 

Is there a matter of "iterative calculation" here, since the data of each month depends on data of previous month ? Should I convert my "year " and "month" integer into date format ?

 

Thank you in advance !

Regards,

Arnaud

 

You can use the Adacent Features option in an AttributeManager to access attributes from the previous feature (month), in fact, the excercise in the FME Academy is very similar to your question.


Thank you very much for your help ! Exactly what I need.

Now I've another challenge : the dataset is a mix of rainfall data for 8 differents locations. Does it mean that I should filter my initial dataset 8 times, use "adjacent feature" for each of them, and then aggregate everything together again ? Thank you in advance.


Thank you very much for your help ! Exactly what I need.

Now I've another challenge : the dataset is a mix of rainfall data for 8 differents locations. Does it mean that I should filter my initial dataset 8 times, use "adjacent feature" for each of them, and then aggregate everything together again ? Thank you in advance.

I used a "FeatureHolder" and enable group processing for my different locations. It's not 100 % correct but it does the trick in this case ("adjacent -1 feature" is sometimes from another location).


You could use a sorter to sort your data by location and date. Then add a conditional to your previous feauture calculation to check that they belong to the same location/group and calculate the running rainfall deficit


Reply