1 Reply Latest reply: Oct 10, 2012 7:21 AM by sivaraj seeman RSS

    Adding a Field and grouping data on load

      Hi All,

       

      A Qlikview newbie here who is a novice with SQL.  I am loading data from an ODBC connection (Access database) and I want to create an extra field which flags the data as one of two values.  Here is the script I have used;

       

      SQL SELECT `campaign_name`,

          EMAIL2,

          emailID,

          `event_name`,

          `project_name`,

          `time_stamp`,

          `workspace_name`

      FROM USAGE;

       

       

      LOAD

      if(workspace_name = 'abc','VALUEA',

      if(workspace_name = 'def','VALUEA',VALUEB) as email_type_final;

      SQL Select *

      FROM USAGE;

       

      The new field has been created but all records have been flagged with both VALUEA and VALUEB when only 100 of the records with the value 'abc' or 'def' shoudl be flagged VALUEA.  Where have I gone wrong here?

       

      Many Thanks