Power Table of Tag History, custom calculate a 3rd column (7.9)

I have a water system customer with a flowmeter we read remotely and get the totalizer data about every 15 seconds. He asked me if I could make a table with hourly usage and perhaps daily as well. I was able to add a page with a power table and a date range along with a multistate button that switches the interval between hours and days and that all works fine to show the totalizer value at those intervals. I do not know how to calculate the difference between adjacent rows in the totalizer column and show that result in the next column. I will mark up a picture to help explain.

(In this screenshot, ignore my experimental numbers in the 3rd column that are in error. Also ignore the fact that the totalizer is counting backwards. The vendor of the meter says they have to physically turn it around to reverse the flow direction, so that should be fixed tomorrow).

Don't use the historian for this. Record to ordinary DB tables driven from SQL Bridge module transaction groups, or equivalent scripting. Then you can use your DB's lead() or lag() functions to give you the per-row deltas.

Lots of relevant topics on how to use those:
https://forum.inductiveautomation.com/search?q=lead%20lag%20order%3Alatest

I appreciate the reply, but this is a limited edition without the SQL Bridge module or transaction groups.

I searched and studied some similar cases before posting this, but I am a machinery guy more than I am a database guru, so I will probably need a lot more detail than I could glean from those other threads in order to get this done.

The DB is MySQL 5.7 (it's been running about 6 years).

So, with scripting, how would you approach this problem?