Skip to main content
Solved

Water deficit calculation

  • May 17, 2023
  • 4 replies
  • 25 views

arnaud.leidgens
Contributor
Forum|alt.badge.img+3

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

 

Best answer by redgeographics

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.

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.

4 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • Best Answer
  • May 17, 2023

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.


arnaud.leidgens
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • 6 replies
  • May 18, 2023

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.


arnaud.leidgens
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • 6 replies
  • May 18, 2023

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).


esietinga
Contributor
Forum|alt.badge.img+5
  • Contributor
  • 6 replies
  • June 8, 2023

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