Difference between 2 values ​​per day over a year in a query

Hi @Docteur

So upon closer review of my example, I concur with you that the first and last values from the period 21h to 5h (the overnight hours) are not correct. The problem with this limit in the hourSelection function seems to be well documented (going back years), but even with the solutions proposed, I am still not getting the correct values.

If the above can be fixed, then I think the problem is solved.

More ideas: