Lag inside an If statement , best practice?

Olek P
edited August 7 in Modeling

Hi

I need to put a lag function inside an IF statement. What is the best practice for this to optimize model performance? Should I break it into to line items? Or would it be more efficient to do: IF NOT x > y THEN 0 ELSE LAG() ?

Thank you

Best Answer

  • Ashutosh
    edited August 8 Answer ✓

    if you are using only one & two if else loop then u can incorporate in same formula. But there are nested if & else then break it.

    Please read below article if u r using nested if else

    Nested if else