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
Read Only Archives
Cloverleaf
Cloverleaf
Xlate IF statement anomoly
Kevin Crist
I have an xlate where i am trying to get an IF statement to work but am having issues. we have to figure out the age of the patient and we have that working and we have to compare that to the age of 18 and then do something. So if the age is 23 it should do what we want, which that part works, but if the age is 4 then it still treats it as it is greater than 18. i have attached the IF statement. is there any thing i can change for this? we have had it many ways with no luck.
Thanks.
Find more posts tagged with
Clovertech
Comments
System
Originally posted by Andy Triggs
Try using > instead of gt.
gt does a string comparison.
> does a numeric comparison.
Kevin Crist
Andy thanks for the reply. i have tried the > sign but then nothing works at all
System
Originally posted by Andy Triggs
It works for me...
Example in attachment places 18 in AdmissionMethod. If I change the > to gt, it places 4 in there.
Jim Kosloskey
Kevin,
On 5.6 Cloverleaf if I want to do that compare as a string but it will actually be numeric data, then I need to be sure the length of the 2 fields are the same. For example 4 is greater than 18 as a string 04 is not greater than 18 as a string.
However, if you use the numeric Category for the compare then it should not matter.
I have tested this in 5.6 and the numeric Category works with a temp variable
@age
being 4 and compared in the IF Action to =18.
What release of Cloverleaf are you on?
Kevin Crist
we are on 5.4.1. i am wondering if this may be our issue somehow.
Jim Kosloskey
Kevin,
Hmmm could be.
Try using the STRING gt with =04 and =18 and see if that does not work the way you want.
If it does, then I would change the Tcl proc to pad the output to 3 characters (or use another proc to pad the temp variable after it is calculated if you have one) with leading zeros and do the compare against 018.
That should synch things up for you. The reason for 3 characters is you could get someone a 100 years old or older (but not likely older than 999).
John Mercogliano
Kevin,
Could you show us how you are setting the age variable and a sample of the data that might populate it. The only time I've had problems with the numeric comparision operators was when cloverleaf was not able to convert the data in the variable to a number.