Skip to main content
Solved

Sum of last 7 Days from Day X

  • November 17, 2020
  • 1 reply
  • 5 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

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.

1 reply

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • 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