Flux language sampling example

I have a datestamp and value columns in my measurement. The datestamp is not evenly distributed and on minute-wise. I want to resample/granulize on per day basis [commulative]
I want to find the flux language query for resampling. Could someone give an example with description?

PS: I am very new to flux language.

@gmatesunny aggregateWindow() is what you’re looking for.

The following will return the daily average of the value field.

from(bucket: "db/rp")
  |> range(start: -7d)
  |> filter(fn: (r) => r._measurement == "example-measurement" and r._field == "value")
  |> aggregateWindow(every: 1d, fn: mean)