• Resolved civilvicky

    (@civilvicky)


    Can we achieve these with calculated field.

    I am making this calculator for the equation : a-b-c-d=0

    where,
    a= number field
    b= number field
    c= calculated field having formula : a-b-d
    d=calculated field having formula : a-b-c

    user will compulsory input a and b field. But, I want to make the c and d calculated field act both as calculated field as well as number field simultaneously. So that when user enters c value, d value should be displayed and when user enters d value then c value should be displayed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author CodePeople2

    (@codepeople2)

    Hello @civilvicky

    Thank you very much for using our plugin.

    Assuming the fields’ names in your form are:

    (a) the number field fieldname1

    (b) the number field fieldname2

    (c) the calculate field fieldname3, untick the “Read Only” and “If the value entered manually, no evaluate equation” checkboxes in its equation.

    (d) the calculate field fieldname4, untick the “Read Only” and “If the value entered manually, no evaluate equation” checkboxes in its equation.

    In the calculated field fieldname3 enter the equation:

    fieldname1-fieldname2-fieldname4

    And in the calculated fieldname4:

    fieldname1-fieldname2-fieldname3

    Best regards.

    Thread Starter civilvicky

    (@civilvicky)

    THis is working, thank you.
    BUt, The results are showing even before all the input fields are completed. For example: if user inputs fields 1 and 2, the value of 3 or 4 are automatically displayed, even before inputting the third value (as our formula is made up of 3 input numbers). Moreover, the fields, 3 and 4 being calculatedfields have placeholder as “0” and which if not present would be better.
    Can we achieve this?

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @civilvicky

    If the fields are required and you want to ensure all of them are populated before evaluating the equations, you must include conditional operations:


    IF(AND(fieldname1|r != '', fieldname2|r !='', fieldname4|r != ''), fieldname1-fieldname2-fieldname4, '')

    And


    IF(AND(fieldname1|r != '', fieldname2|r !='', fieldname3|r != ''), fieldname1-fieldname2-fieldname3, '')

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘calculated field’ is closed to new replies.