grafadruid/druid-grafana

Time shift in query

MathieuEtchepare opened this issue · 2 comments

Hello,

I have a use case where I need to compare data over a day, with a time shift on previous weeks.
For example I need Today, Today - 7 days, Today - 14 days, etc.

Is it possible to use the interval feature to use a do a dynamic shift according to time range?
I could not manage to make it work

Thanks in advance

As an update I found some plugins as MetaQueries and CompareQueries to fulfill this need, but these plugins don't seem compatible with this one, has someone manage to make them work?

I'm not sure about the way you want the data to be shown but I believe you could use two queries on a single panel and use TIME_SHIFT(<timestamp_expr>, <period>, <step>, [<timezone>]) method on one of them to shit the time as you wish (see https://druid.apache.org/docs/latest/querying/sql.html#time-functions)