I pretty new to Grafana, so I apologise in advance, if my questions are pretty “basic”.
We are currently piloting Grafana (v7.1.0) linked to a InfluxDB as frontend to visualise our machine status.
I have a time series with # of produced units per minute.
I would like to transform this time series in a binary “on” / “off” time series, so show 0 (for “off”), if the # of produced units is 0. If the # of produced units is >=1 I would like to show 1 (for “on”).
I am not sure if transformations or overrides are the correct way to get it done or if I can already transform the data in the query from Influx.
I hope the question is clear and I am happy for any support.
Interesting question. I think there are a few possible approaches - with the options being along the lines of what you listed. It should possible to do this in the query itself; maybe not the “nicest” solution, but if you’re using InfluxQL, what comes to mind is something like
SELECT ceil(value/1000) FROM ...
If value is 0 this should return 0. If it’s between 1 and 1000, it should take value/1000 and round it up to the closest integer, which is 1.