• Resolved finanzbeben

    (@finanzbeben)


    Dear all,

    I want to check two values of two different fields.
    If they match, output should be Calc. A.
    If they don’t, output should be Calc. B.

    Input in advanced equations editor:

    (function(){
    IF(fieldname14==fieldname11) return Calc. A; Calc B;
    })();

    Where is my mistake in my logic? I regret my Java skills are not state of the art anymore.

    Kind regards.

    • This topic was modified 4 years, 9 months ago by finanzbeben.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @finanzbeben

    Javascript is a case-sensitive language, do not confuse the “IF” operation in the plugin with the “if” conditional statement of javascript.

    By using the IF operation, the equation would be similar to:

    
    IF(fieldname14==fieldname11, fieldname1/fieldname2, fieldname1*fieldname2)
    

    The same equation by using the if conditional statement:

    
    (function(){
    if(fieldname14==fieldname11) return fieldname1/fieldname2;
    else return fieldname1*fieldname2;
    })()
    

    Best regards.

    Thread Starter finanzbeben

    (@finanzbeben)

    This helped me a lot @codepeople . Thanks for solving my confusion!

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

The topic ‘Simple IF-Statement if two different fields match’ is closed to new replies.