Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
scotly-victor
Creator II
Creator II

New hire & existing Employee

   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
1 Solution

Accepted Solutions
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;

View solution in original post

2 Replies
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;

jayanttibhe
Creator III
Creator III

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