• Resolved Alwin

    (@wp-opti)


    I have a Calculated fieldname7 with this Equation:

    CEIL(fieldname2*fieldname6/100)

    Now I want to change it in to this:

    CEIL(fieldname2*fieldname6/100)
    or
    CEIL(fieldname4*fieldname8/100)
    or
    CEIL(fieldname9*fieldname11/100)

    Is that possible?

    Thank you very much!

    Alwin

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

    (@codepeople)

    Hello @wp-opti,

    What is the condition to decide the operation to apply? In your equation should exist a conditional statement for selecting the operation to apply.

    Best regards.

    Thread Starter Alwin

    (@wp-opti)

    Something like this:

    – If fieldname2 and fieldname6 values are above 0 then CEIL(fieldname2*fieldname6/100)
    OR
    – if fieldname4 and fieldname8 values are above 0 then
    CEIL(fieldname4*fieldname8/100)
    OR
    – if fieldname9 and fieldname11 values are above 0 then
    CEIL(fieldname9*fieldname11/100)

    Plugin Author codepeople

    (@codepeople)

    Hello @wp-opti,

    In this case you should use conditional statements into the equation.

    Note that javascript (the programming language used by the browsers) is case sensitive, please, do not confuse the operation: “IF” included by the plugin with the conditional statement “if” in javascript.

    The equation can be implemented as follows:

    
    (function(){
    if(AND(fieldname2, fieldname6)) return CEIL(fieldname2*fieldname6/100);
    if(AND(fieldname4, fieldname8)) return CEIL(fieldname4*fieldname8/100);
    if(AND(fieldname9, fieldname11)) return CEIL(fieldname9*fieldname11/100);
    })()
    

    Best regards.

    Thread Starter Alwin

    (@wp-opti)

    That worked (again)!

    Your support is absolutely brilliant!

    I just bought the Pro version today, mainly just because I want to pay something.. ??

    Alwin

    • This reply was modified 6 years, 8 months ago by Alwin.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Calculated field with OR Equation?’ is closed to new replies.