Common "if" statement which asks a yes or no question, then outputs one of two outputs based on the answer.


Parameter

Description

Expression

Logical expression that outputs a true or false at each time step. This is typically written in the form of a comparison using >, <, and = operators.

True Part

The output of the IIF statement when the Expression is true.
This can be a constant, a function of time series data, or another IIF statement.

False Part

The output of the IIF statement when the Expression is false.
This can be a constant, a function of time series data, or another IIF statement.

Example Usage as an Expression:

IIF(Sensor()>0,1,0) - Outputs a simple time series of 1 when the current sensor values are positive and 0 when not.

IIF(Close()>Open(),Hour()+1,0) - Outputs the hour of day whenever the tank experiences a net increase in water level.

IIF(Close()*0!=0,Last(Hour())+1,0) - If the sensor stops sending data, this will output the hour that the most recent data point was received.


For information on setting up custom equations and syntax, please refer to Analytical Functions.