GoshPosh / grafana-meta-queries

Grafana plugin for calculating time period metrics like week over week, month over month and year over year etc.
Apache License 2.0
285 stars 71 forks source link

Meta queries in terms of Arithmetic operation doesn't work in grafana 8.0.6 #136

Open BhoomikaAnghan opened 2 years ago

BhoomikaAnghan commented 2 years ago

I am using Elasticsearch(oracle hist as named in image) data source and I want to do some Arithmetic operations (like sqrt or power(exponent)) on Metric field from Query A. I have installed a meta queries data source plugin and I am able to do basic arithmetic functions like (+,*,-,/) but it didn't work for getting sqrt or exponent. It is always returning 0 for sqrt. I have tried to use exponent(25^0.5) for getting sqrt but it doesn't work. Can anyone please suggest to me the right way to do it? I am not sure about this. Is it an issue with the plugin or I am doing something wrong? I could not get any information through the readme file for using this kind of operation from this plugin. expression

drasticElastic commented 2 years ago

I am using an older version of Grafana, but was able to use more advanced Javascript math functions like square root (sqrt) and absolute value (abs) by appending Math.. For example, Math.sqrt(A['queryAlias']). Hope that helps.

asaf400 commented 1 year ago

https://github.com/GoshPosh/grafana-meta-queries/issues/155