Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in expression editor

Status
Not open for further replies.

glenpark

Programmer
Oct 6, 2006
21
US
Hello!

I'm running into an error message in the expression editor when running this IIF statement:

IIF(conditionA=1,UpdateDate,
IIF(conditionB=1 OR conditionC=1,null))

All three conditions are small int variable ports. This IIF statement is contained in a variable part that is string precision 19. The error message looks like this:

<<PM Parse Error>>[IIF]: function cannot resolve operands of ambiguously mismatching types:

According to the editor, the problem stems from the nested IIF statement but I can't seem to resolve it. I'm hoping someone has seen a similar problem or has an idea.

Thanks!
 
You're missing the else condition on the second iif:

IIF(conditionA=1,UpdateDate,
IIF(conditionB=1 OR conditionC=1,null,<else goes here>))

Is UpdateDate as string type?

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
I thought an else condition is optional for an IIF?

UpdateDate is a date/time datatype. But I think it can be converted into a string when moved from one port to another.
 
I could be wrong, but I think else is required.

You must return the proper type to the port in the expression. It can be converted from port to port, but not within a port.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
I just checked the Informatica help, the else is optional.

Just in case, I tried putting in an else condition but still got the same error. Also tried converting the UpdateDate into a string first then feeding it into the variable port, no dice. This problem is pretty perplexing =/
 
Found a solution. I just ditched the IIF and went with a DECODE statement.

DECODE(true,
conditionA = 1, UpdateDate,
conditionB = 1, null,
conditionC = 1, null)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top