2 Replies Latest reply: Nov 8, 2011 5:58 AM by syed.wasti RSS

    Writing if else statement in expression and/or script



      I am very new to QV and so I am having little trouble in doing something that is a small extension of the problem originally posted by Andrew.

      What I want is, I want to show say, kick-back for each customer by multiplying the sales with kick-back rate. For example, if Customer is Bob then Sales * 16.2 else if customer is Karla then Sales * 11.0.


      Something like this:


      dimension  = Customer kick back
      expression = sum({<Customer={'Bob'}>} Sales*16.2, else if {<Customer={'Karla'}>} Sales*11.0, else Sales*9.0 )


      How can I achieve this?