I’m interested in getting data from a UI-driven time range (e.g. using v.timeRangeStart and v.timeRangeStop) and comparing it to data from 1 week before the same time range. If I could generate two tables, I can do all of the comparisons with join/math, or simply visualize both.
I can definitely take last week’s data and timeShift(duration: 7d) and turn it into this week’s timestamps.
But what I can’t figure out how to do is to do math on timeRangeStart/timeRangeStop. I was hoping I could do something like this:
old_data = from(bucket: "main") |> range(start: experimental.subDuration(d:7d, from:v.timeRangeStart), stop: experimental.subDuration(d:7d, from:v.timeRangeStop)) |> timeShift(duration: 7d) ...
But I get this error:
type error 9:19-9:72: time != duration
Any ideas on how to accomplish what I’m trying to do?