Optimal if statements

Options
Lander.Bruneel
Lander.Bruneel Member, ALL USERS, GroupMember, Partner, Certified Model Builder Posts: 2 New Contributor

I want to make sure that I optimize my if statements, hence some question

 

  • If you need to get a maximum of two line items, is it more efficient to use an if statement "if a > b then a else b" or to use the max formula "max(a,b)"
  • Is there any performance difference in "if x<y then a else b" vs “if y<x then b then a” (in case there is only one if statement, in case there is a nested if statement then the most common case should be put first)
  • In some languages the performance is better to have "boolean * number" instead of having an if statement "if.boolean then number else 0".
    In anaplan you cannot apply this, but we could replace the boolean as number with only 0/1's.
    Given the planual "Use conditionals to stop unnecessary calculations", it is probably still better to have the if statement?