Accumulation in Qlik is very easy to do at the front end so i would not do anything on load script and do below instead.
Or use below expression.
Hopefully this helps you.
By the way, the script you supplied looks fine to me. What issue are you having?
Let me know if i can be of any more help.