Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

scotly-victor
Contributor

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
MVP
MVP

Re: New hire existing Employee

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;

2 Replies
MVP
MVP

Re: New hire existing Employee

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
Contributor II

Re: New hire & existing Employee

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