Iff

iff

Returns the second argument if the predicate is true, otherwise returns the third argument.

Spec

iff(predicate, then_value, else_value)

Parameters

predicate - A boolean expression.
then_value - Value returned when predicate is true.
else_value - Value returned when predicate is false.

Return Value

then_value if predicate is true, else_value otherwise. Both must have the same type.

Example

datatable(val:int64)[1, 2, 3]
| extend label = iff(val > 1, "big", "small")
vallabel
1small
2big
3big