11 Replies Latest reply: Apr 19, 2016 6:19 AM by Stefan Wühl RSS

    Variable inside an if statement

      Hi there.


      I'm trying to make the variable in this expression work:


      If( Avg (If( D_SERVICIO like '6*',I_TOTAL)) > $(media_ano_tm)*1.1, red(), If( Avg (If( D_SERVICIO like '6*',I_TOTAL)) > $(media_ano_tm)/1.1, yellow(), green()))


      But for some reason it doesn't work.


      I've also tried (unsuccessfully) this:



      And If I substitute the variable with a number, the expression seems to work fine.


      What could be wrong with it?


      Any suggestion or guidance will be highly appreciated.