Recently, I was wondering whether it was possible to add a dashboard variable to work as a quick range, which would control what days of the week should be shown on a plot or chart. For instance, there could be only two values available, one named labours_day that would represent the days of the week from Monday to Friday, and another, weekend, that could include Saturday and Sunday.
I know about the existence of time regions, in the panel edit options, that, since v6.3, allows to colour those ranges, but it does not let the user decide which data should be selected.
Thanks for your response. It has to do with queries, for instance, I want to be able to show only data from days between Monday and Friday in the “Last 30 days”. I was able to add an interval variable named “day”, and the tried to filter date in the panel query using the Lucene expressions of elasticsearch (something like doc[“field”]).date.dayOfWeek. Unfortunately, it did not work, since no data points where found.
I will upload pictures from the panel soon.
Regards,
Gastón Rial
I have managed to do what I intended from the elasticsearch API, by adding a script to the filter query. For instance, to get only data from Tuesday, I sent a request like the one below.
URL: http://127.0.0.1:9200/_search?pretty