• Resolved williamvwijk

    (@williamvwijk)


    Is it possible to have a function like this:

    (function(){

    if(fieldname3 < 240) and if(fieldname4==’Caravan’) return 0.36*fieldname2;
    if(fieldname3 >= 240) and if(fieldname4==’Caravan’) return 0.38*fieldname2;
    })();

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

    (@codepeople)

    Hello @williamvwijk,

    Yes, it is posible combine multiples conditions, but in javascript the “AND” operation is represented with the double symbol: &&, furthermore you don’t need to use the instruction’s name (if) multiple times in the condition’s section.

    The correct equation would be:

    (function(){
    if(fieldname3<240 && fieldname4=='Caravan') return 0.36*fieldname2;
    if(fieldname3>=240 && fieldname4=='Caravan') return 0.38*fieldname2;
    })();

    or in case you prefer to use the operation “AND” included by the plugin, the equation would be:

    (function(){
    if(AND(fieldname3<240, fieldname4=='Caravan')) return 0.36*fieldname2;
    if(AND(fieldname3>=240, fieldname4=='Caravan')) return 0.38*fieldname2;
    })();

    Best regards.

    Thread Starter williamvwijk

    (@williamvwijk)

    Wow, much thanks! Saves me a lot of time 😀

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

The topic ‘Using multiple conditions in equation’ is closed to new replies.