Missing Data cumulative_sum

Hello,

I used the following SQL query to display the hourly data. Why is the hour 0:00 to 1:00 not displayed. What do I have to change for that?

Where are the data of 0:00-1:00

SELECT non_negative_difference(last(cumulative_sum)) FROM(
SELECT cumulative_sum(non_negative_difference(last(“value”))) FROM “shellies/shellyem-HausSolar/emeter/0/total” WHERE $timeFilter GROUP BY time(1h)
) WHERE $timeFilter GROUP BY time(1h)

timeFilter is now-1d/d (Yesterday)

Query shows only 23 entry

The first Array is 1:00 ;o missing 0:00

Hello @vdcore,
Welcome! It’s hard for me to tell what exactly is going on because I don’t know what the data looks like at each step of the transformation. However, difference() and non_negative_difference() find differences between subsequent records of data, so we should always expect to see n-1 results where n = # of points before applying a difference() function.
This example showcases this:

Does that help? If not, can you please share the data before you apply the non_negative_difference() ? Thank you.