The following example will create a running total (cumulative sum) function 
Comments