I’m using Grafana to create a time-series graph of snow depth data stored in an InfluxDB database. I’m on a PC running Grafana version 7.1.1 (this configuration was set up by my team at work so I can’t update without permission).
Occasionally, the snow depth sensor sends a bad reading causing a spike in the data (e.g. goes from a consistent reading every minute of 2cm to 760cm for a minute, then back down to a steady 2cm). I don’t want these sorts of spikes getting plotted. More specifically, I want all values in range [0, 760] getting plotted, everything else I want excluded.
What I’ve been trying to do is write the query to include such a filter in the WHERE clause, something like:
SELECT (154 - last(“value”))
FROM “tsdata”
WHERE (“var” = ‘1588’ ) AND $timeFilter AND (154 - last(“value”)) <= 760 AND (154 - last(“value”)) >= 0
GROUP BY time($__interval) fill(null)
When I add the bolded portions to my WHERE clause, no data displays at all. I posted about this to the Grafana forum and the consensus seemed to be that this is the way to establish the filter I’m looking for. I am truly stumped as to why this isn’t working for me.
Is there a way to filter out noisy data above/below a certain value in a time series graph? Any advice would be much appreciated!