Looking to generate advanced statistics from a sensor

I have a temperature sensor monitoring my pool, and a remote thermostat that controls my pool heater all using a Shelly Uni. I also have integrated a weather services so I can also record the history of the ambient temperate and humidity over time. I have that all working, but being the nerd I am, I’d love to generate some advanced statistics so I learn, for instance, if I put the pool cover on, how much heat loss do I have over night depending on the air temp and humidity. I have influxDB and Grafana installed, and I have some nice plots to graph the data, but how can I crunch some numbers? I suppose even just exporting to excel would be ok as I could then generate statistics that way, but it’d be nice to have it do that automatically.

There is a statistics integration Statistics - Home Assistant

Also for further calculation the numbers are in the database.