I have got a field in InfluxDB that I want to correct for integer overflow. Given the field FieldA, I want a select statement that returns: FieldA - 65536 if FieldA > 32768, else FieldA.
I can do this using multiple select statements, but I want to use the output in a Grafana panel, and that does not seem to work with multiple statements. Is there a way to perform conditional arithmetic in a single statement? Or any other suggestions?