Q: A sensor is used with certain offset, sometimes a negative value is measured.
For example: A water level sensor WL is mounted on the bottom of a water basin.
2 meters is the lowest level in the basin, the sensor is reading 2 meters or more when the basin level rises.
The sensor offset value is corrected by subtracting “2.0” from the measured level.
Formula >> 2.0-(:WL)
Hard wind will cause waves, sometimes a small negative value is measured.
A: It can be solved by using a formula with “lt”.
When the offset is lower than 2 meters (during a wave), a negative reading is corrected to “0”.
Formula >> lt(:WL;2.0;0;2.0-(:WL))