Query a time range relative to v.timeRangeStart and v.timeRangeStop

Hi all,
Is there a way to request data by doing relative to the selected time range?
For example like that:

  |> range(start: v.timeRangeStart-10m, stop: v.timeRangeStop)

if I use this syntax it gives me this error:

Reading the documentation for range() I found nothing about it.

You can use the date.add() or date.sub() command.

E.g.

import "date"
|> range(start: date.sub(d: 10m, from: v.timeRangeStart), stop: v.timeRangeStop)
1 Like