PowerCenter
- PowerCenter 10.4.0
- All Products
IIF(condition,value1[,value2] )
Argument | Required/ Optional | Description |
---|---|---|
condition | Required
| The condition you want to evaluate. You can enter any valid transformation expression that evaluates to TRUE or FALSE.
|
value1 | Required
| Any datatype except Binary. The value you want to return if the condition is TRUE. The return value is always the datatype specified by this argument. You can enter any valid transformation expression, including another IIF expression.
|
value2 | Optional
| Any datatype except Binary. The value you want to return if the condition is FALSE. You can enter any valid transformation expression, including another IIF expression.
|
IIF( SALES > 100, EMP_NAME )
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
IIF( SALES > 100, EMP_NAME, NULL )
|
|
|
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
IIF( SALES < 100, 1, .3333 )
IIF( SALES > 0, IIF( SALES < 50, SALARY1, IIF( SALES < 100, SALARY2, IIF( SALES < 200, SALARY3, BONUS))), 0 )
IIF( SALES > 0, --then test to see if sales is between 1 and 49: IIF( SALES < 50, --then return SALARY1 SALARY1, --else test to see if sales is between 50 and 99: IIF( SALES < 100, --then return SALARY2, --else test to see if sales is between 100 and 199: IIF( SALES < 200, --then return SALARY3, --else for sales over 199, return BONUS) ) ), --else for sales less than or equal to zero, return 0)
IIF( ISNULL( ITEM_NAME ), DD_REJECT, DD_INSERT)
DECODE( TRUE, SALES > 0 and SALES < 50, SALARY1, SALES > 49 AND SALES < 100, SALARY2, SALES > 99 AND SALES < 200, SALARY3, SALES > 199, BONUS)