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

Arithmetic not working for single values #89

Open reidko opened 4 years ago

reidko commented 4 years ago

I have two "count" queries that are returning a single value each. I want to divide the two values by each other however, when I attempt to do so it returns a 'NaN'. I have verified that I can retrieve the query results independently from the "metaqueries" query 'C' but cannot seem to perform arithmetic on them together, i.e. A/B.

image

Thanks

Gauravshah commented 4 years ago

your query is incorrect, you are plotting as time series but there is no time component in your query

reidko commented 4 years ago

By time component do you mean a group by time? How would you suggest I correct this?

Gauravshah commented 4 years ago

there needs to be a group by with time

Sreevani871 commented 3 years ago

@reidko Hi, Facing similar issue. Here attaching the screenshot of the issue

Screenshot 2021-01-08 at 6 34 15 PM

A['Total'] and B['Satisfied']values are in single value. When I am doing divide on B['Satisfied'] / A['Total'] is showing NaN. While I do B['Satisfied'] / 40.00 its working. Can you please suggest why its throwing NaN?