1

I have a measurement value(x) that varies between 0 and 500. I would like to use a query to return 1 (Boolean) if this value(x) is below a set value(y) for example 200 and 0 if it is above. I need to do this for a discrete visualization I want to use.

In SQL Server I would use a case expression like

case when col_x < 200 then 1  else  0 end
from <tablename> where <some condition>.

But since Influx has no case expression, I have to use a calculation. In question [52533046][1] it is suggested to use something like

 FLOOR(1/(value x/80))

This wont work for example if cpu field is 5. That equation returns 16 so no use as a boolean.

jarlh
  • 42,561
  • 8
  • 45
  • 63
GlobalA
  • 13
  • 3

0 Answers0