4 Replies Latest reply on Aug 8, 2016 11:23 PM by Sreenadha Reddy Palakolanu

# Parameter Result In String Field?

I need to make the following calculation work:

If ([patient age]>PARAMETER AGE) then "Greater Than (result of the parameter)" else "Less Than (result of the parameter) end

How do I write the statement such that the result of the parameter (e.g. 18) appears in the "Greater Than" and "Less Than" strings?  Thank you for your help!  Renelle

• ###### 1. Re: Parameter Result In String Field?

Renelle,

You can use the STR() function to convert the parameter value to a string:

If ([patient age]>[PARAMETER AGE])

then "Greater Than " + STR([PARAMETER AGE])

else "Less Than " + STR([PARAMETER AGE])

end

You could also calculate the difference and then use custom formatting of the field to give you different formats for positive versus negative values.  If performance becomes an issue, come back to this thought.  Otherwise, the above code is likely more straightforward.

Hope this helps!

Joshua

• ###### 2. Re: Parameter Result In String Field?

Fantastic!  Thanks.  This is what I needed.  Renelle

• ###### 3. Re: Parameter Result In String Field?

You're welcome! Happy to help!

• ###### 4. Re: Parameter Result In String Field?

Hi,

IF ([patientage]<[PARAMETER])

then "LessThan " + STR([PARAMETER ])

else  "GreaterThan "+ STR([PARAMETER])

end

Regards,