snowflake.snowpark.functions.iff¶
- snowflake.snowpark.functions.iff(condition: Union[Column, str], expr1: Union[Column, None, bool, int, float, str, bytearray, Decimal, date, datetime, time, bytes, NaTType, float64, list, tuple, dict], expr2: Union[Column, None, bool, int, float, str, bytearray, Decimal, date, datetime, time, bytes, NaTType, float64, list, tuple, dict]) Column[source]¶
Returns one of two specified expressions, depending on a condition. This is equivalent to an
if-then-elseexpression.- Parameters:
condition – A
Columnexpression or SQL text representing the specified condition.expr1 – A
Columnexpression or a literal value, which will be returned ifconditionis true.expr2 – A
Columnexpression or a literal value, which will be returned ifconditionis false.
Examples: