Is it possible to create a moving average with mysql datasource?
I’ve a moving average working with influx, but it does not seem possible in the sample way.
I use grafana 7.4.0.
In case a moving average is possible with a mysql datasource, how should it be done?
I know there are a few methods for achieving this published elsewhere online (if you google “MySQL moving average”). Out of curiosity, do none of them work for you?
@svetb that results in some usable descriptions at first glance, thanks. Need to have a look at those in more details in the coming days/time.
However, for the influxdb data source, the X days moving average can just be selected. Very convenient and nice. It would be nice if the mariadb datasource would be provide the same (if possible).
Great that you worked it out, and thanks for the link! Sorry I wasn’t actually much help haha. And indeed, most SQL databases will generally not be quite as good at this type of stuff “out of the box” as a dedicated time series DB like Influx.
But, it would be nice if Grafana would add an option that creates (inserts) the necessary code ( avg(<name>) OVER(ORDERBY<date>`` ROWSBETWEEN<MA Period> PRECEDING ANDCURRENTROW )
In this <name>, <date> and <MA Period> are to be populated by Grafana. Looks doable to me.