How much data per measurement and day

@crop,
you can use the timeshift function:

Alternatively, I’m not sure if this is what you’re asking for but you can query back in time with:

option offset = duration(v: int(v: now()))
from(bucket: "ABC")
  |> range(start: -2mo)
  |> filter(fn: (r) => r["_measurement"] == "orders")
  |> filter(fn: (r) => r["_field"] == "orders.total_sales")
  |> group(columns: [""], mode:"by")
  |> aggregateWindow(every: 6h, offset: offset, fn: sum, createEmpty: true)

Hello @Anaisdg,
I am already a little desperate. I’ll try it again in a different way.

If I write exactly every hour a measurement with a value and start with it on day 1 at 21:30 and start the evaluation on day 4 at 09:40, then I write x values per day and I am interested in exactly this number of write operations.

So for
Day 1: Number = 3
Day 2: Number = 24
Day 3: Number = 24
Day 4: Number = 10

I would then like to write these results assigned to the respective day also in the database.

For part 1 of the task, the count function fits, doesn’t it?

For part 2, I’m still not clear how to write the data back to the influxdb using flux.

And the additional question is whether the data can still be converted, because I would like to have the correct day to the number and not the successor day.