When

fun When(cond: Expression<Boolean>, result: Expression<T>): CaseWhen<T>

Adds a conditional expression with a result if the expression evaluates to true.