Timestamp with aggregatewindow function

I want to have the average temperature per day. But when i use the aggregation function it sets the timestamp at the end.
I dont understand why. The average temp of a day with timestamp at 0:00 at the next day doesnt seem to make any sense to me. Wouldnt it be better to have the timestamp at 12:00 because thats the middle of the day?

how do i know where the data comes from later? In my opition i need 2 timestamps. One for the beginning and one for the end.

Or do i have later to shift my axis by -12h to have the point in grafana at the middle of the day?

Hello @user642 Welcome!
Deciding how to bound windows of time is always challenging in the space and there are pros and cons to each.
Some people want a window defined by the start of the day 00:00 others want 24:00 but others also don’t like 24:00 because its techinically in the next day so they really want 23:59. You want 12:00. Every use case is different. I like your idea of having bounds.

the window() funciton gives you start and stop window times

If you query your data from the start of a day and then window() youll get start and stop columns that reflect those window start and stop times.

then you can use an empty |> group() to put all of those windows into one table if you need :slight_smile:

I hope that helps.