if…then…else - novix-sa/cubepy GitHub Wiki

Evalúa la condición y devuelve truePart o falsePart según corresponda.

result = cp.iif(condition,truePart, falsePart=None)

Ejemplo:

result = cp.iif( producto=="Producto A", cantidades*1000 , cantidades)
result = cp.iif( cantidades > 10, cantidades , 0)
result = cp.iif( variable_con_choice == "item 1", nodoA , nodoB)