
Re: FORMULA IF in EVENT
David Morel Oct 11, 2016 2:58 PM (in response to marcel hipolito)Check out the Event Management guide, it has information about the use of formulas. Here is what it says about "If" functions:
IfThen Construct (IF)
The function syntax is IF(B, X, Y). If B is greater than zero, it returns the value of X. If B is less than or equal to zero), it returns the value of Y and does not evaluate X. You can use other terms, formulas, or expressions, for B, X, or Y. If B is undefined (no value is assigned) it is treated as zero and returns Y.

Re: FORMULA IF in EVENT
marcel hipolito Oct 12, 2016 10:44 AM (in response to David Morel)Hi David
Thanks for your answer, actually I check this documentation , but what they mention only works for numerical fields,
my question would be more related for "text" fields !!!
do u have any idea ?
Regards
Marcel H.

Re: FORMULA IF in EVENT
David Morel Oct 12, 2016 5:50 PM (in response to marcel hipolito)I have some ideas, but can you more fully describe the use case you are trying to solve? Give me more realistic scenario you are trying to accomplish.



Re: FORMULA IF in EVENT
marcel hipolito Oct 13, 2016 9:17 AM (in response to marcel hipolito)Hi David
thanks for your prompt response.
Please keep in mind that the challenge is to find the right sintaxe for "TEXT" field.
for example having bellow the NCM as "NUMERIC" field the correct sintaxe would be :
IF('NCM)'==10,10,9)
so the formula above is working perfectly
but my target is to make the same in case of NCM became a "TEXT" field, so the question is, how would be the correct sintaxe :
IF('NCM)'=="YES",10,9)
or
IF('NCM)'=='YES',10,9)
Im tried for both of them and did not work !!
Do you have any idea ??
Regards

Re: FORMULA IF in EVENT
Peter White Oct 14, 2016 4:13 PM (in response to marcel hipolito)1 of 1 people found this helpfulHi Marcel,
If you want to use a question with a text answer type to drive a formula then you'll need to provide a restricted range of possible responses and then map those reponse onto numeric values for use in the formula. It's not feasible to do it for a text question with a free form answer as far as I know.
To achieve this you need to edit the question and do the following:
a) set the 'include in cost' attribute to 'custom'
b) set the 'acceptable values' to 'list of choices'
c) when you add the choices at the bottom of the screen you should see a section that allows to map each one to a numeric value for use in formulas
d) refer to the numeric value in the if statement in the formula (although maybe you don't need an if statement when you already have a numeric value to work with, it's not really clear from your post)
Thanks
