• Resolved jcmosquera

    (@jcmosquera)


    Is it possible to have different IF statements, and the one that fits the user input will be shown?

    For example:

    IF(fieldname4==0.154,fieldname18/12384,0);
    IF(fieldname4==0.218,fieldname18/8988,0);

    Meaning: if fieldname4 is 0.154( its a dropdown choice) then result is fieldname18/12384; if fieldname4 is 0.218 then result is fieldname18/8988.

    I tried with the two IFs shown above as my equation but it wont work. Is this even possible? Or is my syntax wrong?

    Thanks!

    https://www.ads-software.com/plugins/calculated-fields-form/

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

    (@codepeople)

    Hi,

    The correct syntax would be:

    IF(fieldname4==0.154,fieldname18/12384,IF(fieldname4==0.218,fieldname18/8988,0))

    And it is read as follow:

    If fieldname4 is equal to 0.154, the result is: fieldname18/12384, else, if fieldname4 is equal to 0.218, the result is: fieldname18/8988, else return 0

    Another possible solution, but this time with the conditional statement “if”, would be:

    (function(){
    if(fieldname4==0.154) return fieldname18/12384;
    if(fieldname4==0.218) return fieldname18/8988;
    return 0;
    })()

    Best regards.

    Thread Starter jcmosquera

    (@jcmosquera)

    Awesome, that worked like a charm!
    Im amazed at the quick response, thanks! Keep a it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple Results’ is closed to new replies.