I want to Display the data based on which Day we are in, like suppose today is Monday then I want to display Friday’s Data on the graph in the Grafana Dashboard.
Below is the query which gives me current day’s data:
from(bucket:"${bucket}")
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) =>
r._measurement == "measurement1" and r._field == "data1Condition"
)
|> last()
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|> keep(columns:["server"])
I searched lot but not found anything related to it. So please help me write this flux query.