6 Replies Latest reply: Jul 10, 2015 6:41 AM by David Gilligan RSS

    SQL Case Statement



      I understand that QlikView does not like MS SQL CASE statements so I am trying to work around this.  It will get more complex but I have to start getting away from the SQL way for this.  I basically want to do a select like this:


      SLELECT something1, something2, ...., UseRate = CASE WHEN [UKURS] = 0 THEN 1

      ELSE [UKURS]



      This will turn all 0s to 1s....what I really want to do next is look up, in another table, an actual rate based on a different field, like a subselect.... SELECT Rate from rateTable WHERE Country = 'UK' AND Month = 4 and Year = 2015.....but I must learn to walk before I can run....


      Thanks for any help,