Setting timerange over several days in a dashboard

I’m looking for a way to set a timerange (let’s say 6:00 AM to 8:00 PM) over multiple days.

Giving an example is the best way to describe my need :slightly_smiling_face: :

I have a dashboard with time range defined from now-18d to now-1d/d

I have several table panels whom I want to display the calculation results only from 6:00 AM to 8:00 PM, and get rid of the range 8:00 PM to 6:00 AM.

Is there a way to do that easily or do I have to clone datasources and destroy manually data from 8:00PM to 6:00 AM ?

Thank you for your feedback

Hello @rbe1733

I can see what you are trying to do, it might be possible depending on your setup. What kind of datasource are you using?

Would it be possible to limit the data in the query instead of doing it in the timepicker?

Hello @marcusandersson,

Thanks for helping me.

I use InfluxDB.
If it is possible, I don’t know how to set the time range in the SQL query.

Hello again,

Hmm, it might be a bit tricky to write this query. May I ask what you are trying to achieve? Maybe there are some other way to solve it?

However I found two forum threads where they are trying to do a similar thing. Maybe something that will help you:

Hey again,

We are using technical data coming from a transfer monitor for stream performance analysis.
We had developed a kind of ETL to extract and transform data, then load it in several influxDB databases and display in Grafana.

Unfortunately, we have a lot of evening and night tasks such as backups, server reboots, … which are fooling the results.
Indeed, I am using mean calculation in my panels and it gets fooled because of wrong data performance between 8:00 pm and 6:00 am.

I had already considered to get rid of this range of data in my transform scripts, because I have all the necessary stuff to do it. But I do think it is a dirty workaround, and looking for way to do it properly in Grafana.

I will have a look to your links. I don’t know if I will be able to use this in Grafana queries keeping my now-18d to now-1d/d range for end users.

Thank you so much for your help.


Just read the 2 articles.

I assume the best way to fix it is to add a flag for the 2 ranges in my transform scripts. This way, it will be easy to get rid of the 8:00PM to 6:00AM range just with a where clause.

Sounds much better than cloning datasources filtering the proper time range.

We have calculated those stats for months. I might be able to handle my existing data, adding this new field in my export format, and create a new datasource to import it. If it works flawlessly, changing the datasource in my panels and adding a where clause might do the job.

Thanks again for your help. Didn’t figure it out before :slight_smile:

1 Like

Sounds awesome! Feel free to get back in this post with any learnings you do :pray: