infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Cloverleaf
IF IN rather than IF eq
Simon Jamison
I need to use an IF statement like in SQL:
IF xxx IN ('A','B','C')
Is this possible?
Many Thanks
Find more posts tagged with
Clovertech
Comments
Paul Bishop
Is this in TCL or a translate? If a translate, there isn't a way to check to see if a field is multiple values. You have to do "if $x eq =1 || $x eq =2" and so forth. TCL is the same way in the if statement, but there is the switch statement which can have multiple values:
switch -exact -- $x {
1 -
2 -
3 {do something}
default {do something}
}
Vince Angulo
It would be kludgey, and I've never done it in a translate, but if the values of A, B and C are static, lsearch might work.
Jim Kosloskey
You could use a table. place the values to be checked against in the left hand column and something consistent (like 'Y') in the right hand column with the default being something like 'N'.
Then in the Xlate TABLE Action pointing to your table and the data item to be checked giving a temp variable followed by an IF testing the temp variable for a value of 'Y'.
Simon Jamison
Sorry, translation rather than TCL .Will try the suggestions and get back to you.
Simon Jamison
Hi,
Paul's idea of:
if $x eq =1 || $x eq =2
works OK and I was going to use it but it turns out that in the live environment there are 7 or 8 instances mapping to 1 so too many to hard code especially if changes need to be made for other hospitals using this in future.
Anyway, I now want to try your idea Jim. I have used a table before and indeed if there was only this position to map I would just use one without an IF but other positions in the field (PV1-8) depend on this value.
Could you expand on how to use the variable in conjunction with the table? I've used a variable in an ITERATE but that's all.
If it's any help in an example I'm mapping (simplified):
GP, GPN, GPR to GP
CON, CPN, CAN to CON
Many Thanks.
Jim Kosloskey
email me and we can discuss off line.