Using Range for Full Day Data

Hi
I am trying to grab data for the last 7 days. The range always has an offset of now(). I can do it in Grafana by using -7d/d. There seems to be no option in flux for this?
Thanks

Hi @PradoEagle,
You can use the range function like this:

  |> range(start: -7d, stop: now())

Thanks for the reply but this creates an offset from now() i.e. 7 days prior to now. This is what I am trying to get around. I want to collect full days 00:00 to 23:59 for the last week. It must be possible as Grafana does it with the -7d/d reference as it is using the same flux language.

If others have this problem then I have found a way around this by using

  |> group()
  |> tail(n: 7)

At the end. This get ride of the part day at the start.

2 Likes