If Then Calculation

Comments

6 comments

  • Rainer Grabowski

    Hi Jesus,

    var tp = @total points;
    var sf = @split field;
    sf == "Yes" ? 2 : 1;
    tp/sf

    Rainer

    -1
    Comment actions Permalink
  • Jesus Villalobos

    Thank you for the reply Rainer, 

     

    Unfortunately, your recommendation didn't work. I get an error "The result is not a valid number"

    0
    Comment actions Permalink
  • Rainer Grabowski

    Sorry, must be

    var tp = @total points;
    var sf = @split field;
    var divider = sf == "Yes" ? 2 : 1;
    tp/divider
    0
    Comment actions Permalink
  • Jesus Villalobos

    That worked! Thank you very much Rainer! I appreciate you taking the time to help me. One last question, how could I clean up the number? Right now the result looks something like this 1000.01, I'd like to show 1,000

    0
    Comment actions Permalink
  • Rainer Grabowski

    In the field settings you can set how many decimals are shown in the item (0,2,4). But it seems your calculation field is text type so the result is text not a real number. Create a new calculation field and enter the code again. Then click the little triangle to the left of the field name and set it to 0 decimals. 

    0
    Comment actions Permalink
  • Benjamin Rieder

    Hi, 

    Want to enter a simple condition in calculation field in Podio: 

     

    IF(@Conversion="Yes";@Principal*@InterestRate*@YearFracConverted; @Principal*@InterestRate*@YearFracNOTConverted) 

    I've done the following in Podio: 

    var Converted = @Converted
    var prin = @Principal
    var int = @Interest Rate
    var fracc = @YearFracConversion
    var frac = @YearFracNotConverted

    Converted ="Yes" ? (prin*int*fracc) : Converted="No" ? (prin*int*frac) : ""

    But is always gives me the result of "Yes" and never of "No"

     

    Thanks for the help! 

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk