Monday, June 20, 2011

A simpler way to write nested IF

Nested IF Expressions can be complex to write in Informatica using IIF. A simpler way to write nested IF is to use the decode function.
For example, if you need to write something like


IF ( A > B ) THEN 1
ELSE IF ( C > D ) THEN 2
ELSE IF ( E > F ) THEN 3
ELSE 4


can be written as


DECODE(TRUE,A>B,1,
C>D,2,
E>F,3,
4)
Is that helpful???

No comments:

Post a Comment