Skip to main content
Solved

Sum of last 7 Days from Day X

  • November 17, 2020
  • 1 reply
  • 4 views

I have 2 Columns.

First Column is the Date.

The second Column has a value.

I want to see for each Day in the first Column the sum of the last 7 Days.

How can i do that in FME?

Sum

Best answer by nielsgerrits

AttributeCreator, click Advanced, check "Enable Adjacent Feature Attributes" and set "Number of Prior Features" at 7.

 

Create a new attribute "result" with the value 

@sum(@Value(B),@Value(feature[-1].B),,@Value(feature[-2].B),@Value(feature[-3].B),@Value(feature[-4].B),@Value(feature[-5].B),@Value(feature[-6].B))

AttributeCreatorParameters

View original
Did this help you find an answer to your question?

1 reply

nielsgerrits
VIP
Forum|alt.badge.img+54
  • Best Answer
  • November 17, 2020

AttributeCreator, click Advanced, check "Enable Adjacent Feature Attributes" and set "Number of Prior Features" at 7.

 

Create a new attribute "result" with the value 

@sum(@Value(B),@Value(feature[-1].B),,@Value(feature[-2].B),@Value(feature[-3].B),@Value(feature[-4].B),@Value(feature[-5].B),@Value(feature[-6].B))

AttributeCreatorParameters


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