Hello @rphrus,
Thank you very much for using our plugin.
Your equation can be implemented as follows:
IF(50<fieldname1+30, 20-fieldname1, fieldname1+30)
Note you said subtract the calculated value from 50. So, the second parameters is 20-fieldname1 because:
50 – (fieldname1+30) = 50 – fieldname1 – 30 = 20 – fieldname1
If you want to subtract 50 from the calculated value, the equation would be:
IF(50<fieldname1+30, fieldname1-20, fieldname1+30)
In this case, the second parameter is: (fieldname1+30)-50 = fieldname1-20
Best regards.
Thread Starter
rphrus
(@rphrus)
Hi,
How can I prevent the calculation from displaying the result when I have not entered a number on fieldname1 yet?
Thank you
-
This reply was modified 2 years, 6 months ago by
rphrus.
Hello @rphrus
Assuming you have the mathematical operation fieldname1+fieldname2 and want to evaluate the mathematical operation when the user has filled in both fields. By default, the plugin preprocesses the fields’ values to use them in mathematical operations. When the fields’ values are empty, the equation result will be zero.
So, you can edit the equation as follows:
IF(AND(fieldname1|r != '', fieldname2 != ''), fieldname1+fieldname2, '')
Note I checked the fields’ values with the |r modifier. I’m telling the plugin:
If the raw values (without preprocessing) of fields fieldname1 and fieldname2 are different from the empty text, evaluate the mathematical operation or return empty text otherwise.
Best regards.
Thread Starter
rphrus
(@rphrus)
Thank you for taking the time to answer my question. My fieldname1 is an input number and fieldname2 is a calculated value field. So, how would this work?
Hello @rphrus,
The process is just the same as described previously. You should check the raw fields’ values and evaluate the mathematical operations if the condition is satisfied.
Best regards.