This actually works but is very slow (> 800ms) put merge("SELECT *,SUM (amount) OVER (ORDER BY recID) AS balance FROM myAccountName") into tSQL
I have settled on my earlier suggestion Earlier suggestion results in 20ms performance. --------------------------------- I believe it’s sorted (forgive the pun) As the data is stored in an SQLite db I have used the db to sum the values then worked from the top. Like below. This results in approx. 20ms for each sort direction. I have looked into a running total calc using SQLite but the solutions I found seemed rather complicated. Sometimes asking for help then presents a solution. ———————————————— Thanks Terry > On 29 Mar 2020, at 22:24, doc hawk via use-livecode > <use-livecode@lists.runrev.com> wrote: > > UPDATE theTable SET tBal=tBal(idx -1) + charge WHERE idx > MIN(idx); _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode