Compare data from two different arbitrary dates


I am looking for a way to compare data from influxDB, for example I need to compare the number of persons that are stored in July 8 between 7:00 a.m and 10:00 a.m with the number of persons of July 3 between 9:00 a.m and 11:00 a.m. This dates and hours must be selected by the user in the Dashboard, preferably with a date time picker or something similar. And all the data present in this time range will be added together.

The temporary solution that I have implemented, is to create multiple variables to select these dates.

The user can select the variables:

With these variables I use bar charts to graph the sum of this query in the next way.

This solution works, but I would to ask if there is a more efficient way. For example, if there is a way to use two date-time pickers instead of using multiple variables.

Thanks for your help!

1 Like


Therein lies the issue, you get only one date picker in grafana per dashboard. Unless there is a calendar plugin you could use.