Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

glenpark (Programmer)
11 Feb 07 19:31
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!
ArtieChoke (Programmer)
11 Feb 07 20:45
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

glenpark (Programmer)
11 Feb 07 21:52
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.
ArtieChoke (Programmer)
11 Feb 07 22:04
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

glenpark (Programmer)
11 Feb 07 22:50
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 =/
glenpark (Programmer)
12 Feb 07 0:03
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)

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close