• Resolved mate2001

    (@mate2001)


    I have a form with various dependencies. Is it possible to give an instruction that implements the following:if one value of an equation is 0, then the whole equation is 0.

    Example: I calculate fieldname1 (5) + fieldname2 (7) = 12
    So far so simple. But if fieldname1 is not 5 but 0, then
    7 should be the result. (fieldname1 (0) + fieldname2 (7) = 7).
    In this case, however, I want the entire result to be 0.

    The point is that users can calculate something in the frontend. One value is determined in the background by calculations and the other value must not be 0. If it is, the entire equation must be 0. (Otherwise a different result is calculated in the background). If one value is 0, everything must be 0.

    Can something like this be implemented?

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

    (@codepeople)

    Hello @mate2001

    In short, you want the result of the equation be the sum of both numbers, only if both operands are different from zero. In this case, the equation can be implemented as follows:

    IF(AND(fieldname1, fieldname2), fieldname1+fieldname2, 0)

    And that’s all.

    Best regards.

    Thread Starter mate2001

    (@mate2001)

    great, thank you very much. What is the function if fieldname1 and fieldname2 are not added but multiplied or divided? Can you please tell me that too? That would be great.

    Thread Starter mate2001

    (@mate2001)

    Sorry, that wasn’t a clever question. I’ve just seen it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.