When using a Stat Visualisation, the time range is not working as expected.
The sample Date has 5 columns, 1st column is the date, 2nd to 4th are the numbers of Sites 1-4.
Screenshot:
The first row is not within the time range (last 30 days) but it is still considered in the calculations.
The calculations within the time range are only true, when the first data row is deleted from the table.
The time range did not change, but the calculations did, Since the 1st data row was removed. Is there a way, to use the time range option? If the time range can not be used, I guess the 1st column is useless as well?
What does the query for generating the data look like?
No special query is used. Just a csv file. Where do I need to look to get the info you need?
Screenshot:
The transformation tab:
I looked at the Grafana Stat page and created the sample data like in the post shown at the section “Time-series data“
I have never used CSV-data source, so maybe a stupid question, but have you tried it in any other visualisation, e.g. a time-series plot or a table?
When using a postgres data source (as I usually do) the data are filtered into the right time interval before it gets into grafana. I wonder if you should do filtering on date somewhere?
If you use the same data and source in a heatmap, the date range works. So that’s why I am wondering why it’s not working on the Stat visualisation.
I have tried with and without datatime transformation, same result on Stat vis. I can type in a full timestamp and use that without datetime transformation, same result.
Since all the real data files are in csv format, I thought, I spare myself the step to import them into db like influx.
Update:
Sorry, it was not refreshed at time I was looking at the screen. Still not working with csv files. I guess I will use a database.
–
Thank you! That’s it.
Looks like the Timestamp needs to “2026-01-30T00:00:00.0Z“ not just “2026-01-30“
1 Like
Thanks for the update. Yes, Grafana requires the full ISO timestamp format with time and timezone. Glad you found the issue!
I send the reply too early. Th issue is still there in Stat visualisation with the csv file. A full timestamp or an EPOCH time does not help to make use of the set date range. While it is working on the heatmap, it is not working on the Stat
It looks like the range is only applied to the graph in the background, but not the percentage calculations and the trend arrow up/down.
TimeRange set to 30 days, the graphs (in the red rectangles) are visible
The range set to 7 days, the graphs are gone, but the calculations stay the same. So the date is working, but not the percentage and arrow up/down trend.