• No need to LAG. Summary Functions are windowed too. It reads much cleaner.

    select PK_S, MonthDate,Leavers

    ,SUM(Leavers) OVER(ORDER BY PK_S DESC

    ROWS BETWEEN CURRENT ROW AND 11 FOLLOWING) as RTM

    from Headcount

    order by PK_S

    set statistics time,io off;

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills