Calculated field for If/then statement

I am trying to figure out how to create a percentage paid field that will display the current most paid stage payment. i.e. 

if the client has paid 10% percent only it will display 10 or 10%

If the client has paid 40% and 10% it will display 40 or 40% 

and so on 

I am currently trying to do this with IfElse but am not entirely sure if that is correct

if anyone could help that would be great 

  • Good morning Penny,

    You could just do the math in your formula. I assume you have the total_amount and paid_amount.

    so your percentage paid = paid_amount * 100 / total_amount

    To get the decimal:

    divide(multiply($paid_amount,100),$total_amount)

    you will likely want to round round that, for example to 2 decimals:

    round(divide(multiply($paid_amount,100),$total_amount), 2)

    To get it as a string field with the % sign, you can turn it into a string

    toString(divide(multiply($paid_amount,100),$total_amount), 2))

    and concatenate the % sign

    concat(toString(divide(multiply($paid_amount,100),$total_amount)), 2)))

    Test this because it's off the top of my head and I didn't verify the syntax Slight smile

    FrancescaS

  • Hi ,

    Can you clarify how you are tracking the staged payments and what module you are looking to display the highest paid percentage amount? Do you have a specific field tracking the percentage paid of a given payment or is that also a mathematical calculation you need to perform?

  • I recommend to add a check for avoiding division by zero errors, especially when this kind of formulas is introduced later on and you are having empty fields in records ;-)

    ifElse(
        or(equal($paid_amount,0),equal($paid_amount,"")),"0",
                concat(toString(divide(multiply($paid_amount,100),$total_amount)), 2)))
    )

    Bests

    Björn