2 Replies Latest reply on Sep 5, 2018 11:40 PM by Premnath v

# Window Sum with Offsets

Hi Friends,

I am trying to understand window calculations. Here, what I want is to calculate the sum of sales for particular partition i.e. from Index 1 to index 5. Please refer screenshot.

I am unable to understand the formula for Window_Sum(Expression, [Start, end])

Start and end is offset i.e. First()+n and LAST()-n.. while first is always a (-ve) number and Last is (+ve).

Can you please give and an example of window sum calculations for calculating sum of sales for specific partition.

• ###### 1. Re: Window Sum with Offsets

So this formula would stop at each SUM(SALES) and Mark it 0 and then would look 3 more spots above it and would calculate Window_SUM of the 4 values.

Thanks

Deepak

• ###### 2. Re: Window Sum with Offsets

so in you formula offset is -3, i.e (0,-1,-2, -3)

As per the syntax Window_Sum(Expression, [Start, end]),     -3 is first() and 0 is Last. ?? i,.e 0 means it should add till the bottom of Last?