Problem with query to display graph

I am trying to display temperature data converted from fahrenheit to celsius on dashboard grafana which is on production server, when I add math() function to query, graph does not display anything but when I try to display it in grafana which is on local server (laptop) graph displays the temperature data.
What is wrong and how to fix it?

Thank you for your help…


Are you using the same influxdb version and have the same/similar schemas/data in test and production?


Thanks @mefraimsson

I’m using different influxdb version, but same schemas/data in test and production.
I do math() function in different query to calculate influxdb shard and it works.

How to solve this problem?

Okay. Please include the query that’s working local/not working prod.


Thanks @mefraimsson

query that’s working at production to display database size :
SELECT sum(“diskBytes”) / 1024 / 1024 FROM “influxdb_shard” WHERE (“database” = ‘_internal’) AND $timeFilter GROUP BY time($__interval), “database”

query that’s not working at production to display temperature :
SELECT (“tempf” - 32 ) / 1.8 FROM “rawdata” WHERE (“ID” = ‘IBANDUNG4’) AND $timeFilter

But that’s two completely different queries.

Yes @mefraimsson that’s different.
am i writing the wrong query to display temperature?

I was meaning that you’re operating on two completely different metrics. The first one which working are using a sum and group by but the other doesn’t - maybe the reason?

Thanks @mefraimsson

The reason for the data I want to show is different. The first metric to display database size while the second metric to display the results of data conversion from fahrenheit to celcius.

Is there any other solution so I can display the converted data from fahrenheit to celcius?


I just tried changing the first query in this panel to the following and it seems to work:

SELECT ("value" - 32) / 1.8 FROM "logins.count" WHERE ("hostname" = 'server1') AND $timeFilter 


1 Like

@mefraimsson i try and it still does not work :frowning_face:

Change time range to something where you know that you have data? Change unit to Celsius. Try changing display mode to points instead of lines.

If you still don’t see any data points, please refer to Using Grafana’s Query Inspector to troubleshoot issues


thanks @mefraimsson
This result when i’m using Grafana’s Query Inspector to troubleshoot issue

How to enable to construct rhs transform iterator?

Looks to me like tempf field is a string data type. Correct?


Yes @mefraimsson, tempf field is a string

Not sure you can cast it to float but look at influxdb documentation.

Best solution is probably to store the value as float data type.

Good luck


Ok @mefraimsson, I read the influxdb documentation and i found this :

I also check tempf field in my database and i found data type of tempf field is float