If-Then-Else Expression
An if-then-else expression takes the general form:
If
boolean-expression
Then
then-expression Else
else-expression
If the
boolean-expression
evaluates to true
then the if-then-else expression evaluates to the then-expression
. If the
boolean-expression
evaluates to false
then the if-then-else expression evaluates to the else-expression
. Otherwise, the if-then-else expression is non-evaluable.
Example
Consider a boolean variable
MultiBorrower
, a repeated numeric variable MultiBorrowerLoan
and an un-repeated numeric variable SingleBorrowerLoan
.The expression:
If MultiBorrower Then Sum( Collect( MultiBorrowerLoan ) ) Else SingleBorrowerLoan
will evaluate to the borrowers' total loans irrespective of whether it is a multi-borrower agreement or a single-borrower agreement.