Please do not double-posting - it's not helpful. Your example-app is quite (too) large which suggest that real-data are including instead of dummy-data, see also: Preparing examples for Upload - Reduction and Data Scrambling.
A very good explanation for rolling periods could you find here: Calculating rolling n-period totals, averages or other aggregations.
You are right marcus_sommer, it wasn't my purpose to double-posting. I was not sure if I had posted at the first time.
I've find what I was looking for in Calculating rolling n-period totals, averages or other aggregations.
Thanks for your help.