Logical Functions

IF condition THEN value_if_true ELSE value_if_false

Returns the true value when condition is nonzero; otherwise returns the false value.

Nested ELSE IF expressions are supported.

Example: IF Inventory > 0 THEN Demand ELSE 0

Example: IF Position = Position.Retailer THEN Demand ELSE IF Position = Position.Producer THEN Production ELSE Orders

Compatibility alias: IF(condition, value_if_true, value_if_false) and IF THEN ELSE(condition, value_if_true, value_if_false).

ZIDZ(numerator, denominator)

Returns 0 when the absolute denominator is less than 1e-12; otherwise returns the quotient.

Example: ZIDZ(Revenue, Units)

XIDZ(numerator, denominator, fallback)

Returns fallback when the absolute denominator is less than 1e-12; otherwise returns the quotient.

Example: XIDZ(Revenue, Units, Average_Price)

SAFEDIV(numerator, denominator [, fallback])

Equivalent to XIDZ with an optional fallback. The default fallback is 0.

Example: SAFEDIV(Output, Labor, 0)

Supported logical aliases

The native engine also accepts AND(a, ...), OR(a, ...), and NOT(a). It also accepts aggregate-style ANY(a, b, ...) and ALL(a, b, ...), including selected array ranges such as ANY(State[Region=East:West]). They return numeric 1 or 0; zero is false and any nonzero value is true.


Yano Simulator Help — Version 0.2.0, Build 20260809