If then otherwise
Returns one value if a specified condition evaluates to true and a second value if the condition evaluates to false.
Notes
- The "If" condition must be a boolean condition, returning TRUE or FALSE.
- Then/Otherwise conditions may be either text strings or numbers, but both conditions must be of the same type.
Example Use Case
A car dealer wants to inform customers whether or not their warranty is still valid when they bring their car in for repairs.
Because the "if" condition must be boolean, creating this Eligibility Rule is a two-stage process.
- Create an Eligibility Rule that determines whether or not the purchase date for the car was within the last 3 years. This defines the warranty period.
- Create an if then otherwise Eligibility Rule to return a different message to customers based on whether or not the purchase date Eligibility Rule returns TRUE or FALSE.
MXO supports nesting up to three levels of if/then/otherwise functions, inside each other, in a single expression.
Example purchase date Eligibility Rule
time between now and Purchase Date in "years" ≤ 3
Example if then otherwise Eligibility Rule
if Car purchase date less than 3 years ago then Action name of repairs covered
under Warranty otherwise Action name of 10 percent Off Labour for Repairs