3 Replies Latest reply on Feb 15, 2017 1:09 PM by Srinidhi Narayan

# Can't understand WINDOW_SUM

Hello again,

In the step How (3) from the attached workbook, can someone explain to me what is this calculation doing?:

IF WINDOW_SUM([Warnings],-[Moving Window to Consider]+1,0)>=[Incidence Threshold] THEN WINDOW_SUM([Warnings],-[Moving Window to Consider]+1,0) END

Why are they subtracting "Moving Window to Consider" and then adding +1?

Thanks!

Esther

• ###### 1. Re: Can't understand WINDOW_SUM

Hi esther,

Please take a look at this wonderful document to understand how it works:Total() vs Window_Sum()

Thanks,

Tharashasank

1 of 1 people found this helpful
• ###### 2. Re: Can't understand WINDOW_SUM

Thank you, Tharashasank, I'll get into that document

I have only given it a superficial reading (no time for more, now), but, if I understand my problem correctly, my main difficulty is around the subtracting and incrementing 1, not exactly around the window_sum() definition. Maybe the post you refer addresses that indirectly?

Regards,

Esther

• ###### 3. Re: Can't understand WINDOW_SUM

I suspect it has something to do with the offset parameter of the window_sum function.    The Window_sum function will apply to the value matching the offset + all values up to and including current value.  In this case, I suspect they want the window to be inclusive of current value, and hence have to "reduce it by 1" (notice they start negative, and then add one, to reduce the window size to match the parameter being used).  A negative offset means the window begins at that many values before the current value.

2 of 2 people found this helpful