- Common Content for Data Integration 10.5
- 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 )
names = ['John', 'Kevin', 'Laura']
IIF( SIZE(names) > 2, names[2], names[0] )
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)
I have an issue using IIF. The formula is this....
IIF(ISNULL(SUCCESS_RATE)=TRUE,1,0)
SUCCESS_RATE is either a number between 0 and 1, or it is NULL. I am evaluating 204 records with this formula. The output of the Expression object becomes only 14 records when I include this formula. Only the 14 records with a NULL SUCCESS_RATE are included in the output of the object. I expected those 14 records to give me a value of 1 and the rest to give me a value of 0 from this formula. Instead they were filtered. I had to change it to a DECODE to have all 204 records included and the formula perform correctly. Is this a hidden feature of IIF? I have used it many times. Am I inadvertently filtering records in some cases when I use it?
Hi William,
We’re working to address your comments and will get back to you.
Thanks, Informatica Documentation team
Hi William,
We recommend that you contact Informatica Global Customer Support to address this query because this query is related to a specific use case based on product behavior.
Thanks, Informatica Documentation team