How to arrive trailing 4 weeks data

Hi All, I have week and sales person wise revenue , how to arrive sales person wise trailing 4 week revenue .

example (expected Output)

you should be able to use window sum

windowSum({wk_revenue},[{Week} ASC],1,4,[{sales_person}])

1 Like

Thank you Max, your input helped me in completing my task

2 Likes

Hi @sbaskax Did this answer your question? If so, please help the community out by marking this answer as "Solution!

1 Like

Hi Knambuti,

“windowSum({wk_revenue},[{Week} ASC],1,4,[{sales_person}])” didn’t give the required output, but by changing “1,4” to “0.3” i got the required output.

formula which i used to get the output
windowSum({wk_revenue},[{Week} ASC],0,3,[{sales_person}])

1 Like

Thank you for updating us @sbaskax on what worked for you! I am marking your reply as Solution. (Of course, let us know if there is anything else we need to add to the thread to help our Community members.) Thx! :slight_smile: