3 Replies Latest reply: Sep 27, 2012 2:11 PM by zahid_zha RSS

    SQL Code Conversion to QlikView

      Hi All,

       

      I am currently converting some of our business's SQL have created. One of the case statement is not returning correct result from database.

       

      LOAD

      ........

      ....

      SQL SELECT

      ....

      ...

      ,Case when (em.elapsed_months >=6 and em.communications >=6) then 1 else  0 end as M6_Non_Engager

      ,case when em.elapsed_months >=4 then 1 else 0 end   as M4_Non_Engager

      ,case when em.elapsed_months <=4 then 1 else 0 end as  Engaged

      .....

      // Following is the case statement which is returning 'No Value' always but in database actually there are all values.

      ,case when dm.score  = 1 then 'Low Email Tech Laggards'

           when dm.score  = 2 then 'Low Email Gamers'

           when dm.score  = 3 then 'Moderates, without Email'

           when dm.score  = 4 then 'Moderates, with Email'

           when dm.score  = 5 then 'App & Email Gamers'

           when dm.score  = 6 then 'Avid Mobile Web & BBM'

           when dm.score  = 7 then 'Super Users'

           else 'No Value' end as Behavioral_Segment

      .......

      , count(distinct ld.e_email) as Countx

       

      Please help