• Resolved edrod

    (@edrod)


    (function(){
    if(fieldname2 > fieldname3) return ROUND(fieldname1/fieldname2*100,0,1);
    if(fieldname3 > fieldname2) return ROUND(fieldname1/fieldname3*100,0,1);
    })();

    I have the following equation that gives me an “x” result. I need to make that if this result “x” is >10 the result returns 10, if the result is <=10 it returns the formula. Can someone help me?

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter edrod

    (@edrod)

    I also have the equation:

    ROUND(fieldname4*10/fieldname5*fieldname6.0.01);

    I need that if the result is >10, return value 10, if not return the result of the equation.

    Plugin Author codepeople

    (@codepeople)

    Hello @edrod

    There is a problem with your equations. If you want to round the result in multiples of 0.01, you must use the point as the decimal separator. About the equation’s result, You should use the MIN operation because you need the minimum value between the equation and 10:

    MIN((function(){
    if(fieldname2 > fieldname3) return ROUND(fieldname1/fieldname2*100,0.1);
    if(fieldname3 > fieldname2) return ROUND(fieldname1/fieldname3*100,0.1);
    })(), 10);

    or

    MIN(ROUND(fieldname4*10/fieldname5*fieldname6,0.01), 10)

    Best regards.

    Thread Starter edrod

    (@edrod)

    I need the result of the equation to be at most 10

    Plugin Author codepeople

    (@codepeople)

    Hello @edrod

    Yes, I understood your initial question, for this reason you must use the MIN operation, to ensure the result is not greater than 10.

    For example, MIN(30,10) return 10

    Your equations would be:

    MIN((function(){
    if(fieldname2 > fieldname3) return ROUND(fieldname1/fieldname2*100,0.1);
    if(fieldname3 > fieldname2) return ROUND(fieldname1/fieldname3*100,0.1);
    })(), 10);

    MIN(ROUND(fieldname4*10/fieldname5*fieldname6,0.01), 10)

    Best regards.

    Thread Starter edrod

    (@edrod)

    the first question worked.

    so that the result is not less than 100, how to do it?

    Plugin Author codepeople

    (@codepeople)

    Hello @edrod

    I’m sorry, but if the result must be less than or equal to 10, it cannot be at the same time greater than 100. It has no sense.

    Best regards.

    Thread Starter edrod

    (@edrod)

    Sorry, maybe I didn’t know how to express myself. this would be for another equation. but I’ve already solved it by applying MAX.
    Thanks a lot for the help.

    Doubt closed

    Plugin Author codepeople

    (@codepeople)

    Hello @edrod

    Yes, that is, the MAX operation is the correct one in this case. Excellent!!!!

    Best regards.

    Thread Starter edrod

    (@edrod)

    Good Night (@codepeople).

    a new question arose.

    I have the following equation:

    ROUND(fieldname74+fieldname75+fieldname76+fieldname78+fieldname77+fieldname79+fieldname80,0.01);

    I need that whenever the result of the equation is = 70, I return 100

    if the result is not =70, return the result of the equation.

    Can you still help me?

    Plugin Author codepeople

    (@codepeople)

    Hello @edrod

    In this case, you can edit the equation as follows:

    
    (function(){
    var result = ROUND(fieldname74+fieldname75+fieldname76+fieldname78+fieldname77+fieldname79+fieldname80,0.01);
    
    return IF(result == 70, 100, result);
    })()
    

    Best regards.

    Thread Starter edrod

    (@edrod)

    sensational!!! It worked.

    This is the best plugin I’ve found in the category and the best support.

    Thank you!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Set maximum result’ is closed to new replies.