Hi,
In transformer stage we have one input and one outputlink. For one of output field we have following derivation
If LkpSYSTEMIC.ACCOUNT = '119FCE' or '119FSA' Then 1 Else 2
When we pass LkpSYSTEMIC.ACCOUNT = '119FCH' then from above expression it gives output value 1
When we changed the expression as follows
If LkpSYSTEMIC.ACCOUNT = '119FCE' or LkpSYSTEMIC.ACCOUNT = '119FSA' Then 1 Else 2
In this case it gives value 2.
What is wrong in the first expression which gives value as 1?
Thanks,
OR Operator
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The rule here is, in a Boolean context: 0 or "" is False, anything else is True.
'119FSA' is therefore True
LkpSYSTEMIC.ACCOUNT = '119FCE' or '119FSA' is parsed as: (LkpSYSTEMIC.ACCOUNT = '119FCE') or ('119FSA')
(Logical operators have the lowest precedence.)
(LkpSYSTEMIC.ACCOUNT = '119FCE') or ('119FSA') is True because ('119FSA') is always True, so that your If..Then..Else expression will always return 1.
Your second formulation is the correct way to perform the test that you intended.
LkpSYSTEMIC.ACCOUNT = '119FCE' or LkpSYSTEMIC.ACCOUNT = '119FSA' is parsed as (LkpSYSTEMIC.ACCOUNT = '119FCE') or (LkpSYSTEMIC.ACCOUNT = '119FSA')
'119FSA' is therefore True
LkpSYSTEMIC.ACCOUNT = '119FCE' or '119FSA' is parsed as: (LkpSYSTEMIC.ACCOUNT = '119FCE') or ('119FSA')
(Logical operators have the lowest precedence.)
(LkpSYSTEMIC.ACCOUNT = '119FCE') or ('119FSA') is True because ('119FSA') is always True, so that your If..Then..Else expression will always return 1.
Your second formulation is the correct way to perform the test that you intended.
LkpSYSTEMIC.ACCOUNT = '119FCE' or LkpSYSTEMIC.ACCOUNT = '119FSA' is parsed as (LkpSYSTEMIC.ACCOUNT = '119FCE') or (LkpSYSTEMIC.ACCOUNT = '119FSA')
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.