2 Replies Latest reply: Nov 19, 2017 7:39 PM by Jayant Tibhe RSS

    New hire & existing Employee

    scotly victor

         Hi All,

       

      I have required to find new hire or existing employee

       

      Here  sample data ,Is it feasible to achieve in edit script?

      Monthemployee idOutput
      1-Jun-17101new hire
      2-Jun-17102new hire
      3-Jun-17103new hire
      4-Jun-17104new hire
      1-Jul-17101na
      2-Jul-17102na
      3-Jul-17103na
      4-Jul-17105new hire
      1-Aug-17101na
      2-Aug-17102na
      3-Aug-17103na
      4-Aug-17106new hire
        • Re: New hire existing Employee
          Sunny Talwar

          May be like this

           

          LOAD Month,

               [employee id],

               If([employee id] = Previous([employee id]), 'na', 'new hire') as Output

          Resident ....

          Order By [employee id], Month;

          • Re: New hire & existing Employee
            Jayant Tibhe

            Hi

            You can try using Peek function like :

             

            Test:
            LOAD Month, [employee id], Output
            FROM [https://community.qlik.com/thread/282234]
            (html, codepage is 1252, embedded labels, table is @1);
            
            
            Test_New:
            LOAD Month,
                 [employee id],
                 IF([employee id]=Peek([employee id]), 'Existing','New') as [Existing Employee Flag]
            Resident Test
            Order By [employee id], Month;
            
            
            Drop Table Test;
            Exit SCRIPT;
            
            
            
            
            

             

             

            Thanks

            Jayant