How to define a time range for a panel or query that starts on the 16th of the month and extends to now?

Trying to understand how to define a query or panel that will always show data for a time range from the last “16th day of month” until now, so - as of this posting, it’s Feb 28, so I would want the time range to reflect Feb 16 - Feb 28. On March 3rd, I would want it to reflect Feb 16 - March 3rd. On March 17, it should reflect 1 day, March 16 - March 17 (maybe that’s 2 days, whatever).

I’m familiar with the “relative time” and “time shift” fields on the panel and I’m familiar the query fields, but I can’t figure out how exactly to achieve this.

Welcome to forum @bdruth

What is your data source. Probably best to do it in the query itself

Thanks @yosiasz!

InfluxDB, sorry I didn’t mention that.

1 Like

are you using flux query language or influxql query language

Boy, that’s a good question, I think it’s influxql, but I’m game to change that if it’s straightforward to do? I think I’ve used flux from Chronograf, but not from Grafana, so if it’s something that’s doable in flux, but not so much in influxql, then just help me figure out how to do that? :smiley:

in your data source connections what do you see for your influxdb connection setting. should tell you if it is influxql or flux

or another way is
if you see SQL select statement in your dashboard influxdb connection then it is influxql

Yeah, it’s influxql … can both be used in the same Grafana instance? Same dashboard?

Yes datasources are panel based not dashboard based. You can “mix” any datasource bcs they are separate

I am pretty sure you can create these sort of custom time ranges using Flux, but it will be a learning endeavor.

Some things worth exploring…