Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have required to find new hire or existing employee
Here sample data ,Is it feasible to achieve in edit script?
Month | employee id | Output |
1-Jun-17 | 101 | new hire |
2-Jun-17 | 102 | new hire |
3-Jun-17 | 103 | new hire |
4-Jun-17 | 104 | new hire |
1-Jul-17 | 101 | na |
2-Jul-17 | 102 | na |
3-Jul-17 | 103 | na |
4-Jul-17 | 105 | new hire |
1-Aug-17 | 101 | na |
2-Aug-17 | 102 | na |
3-Aug-17 | 103 | na |
4-Aug-17 | 106 | new hire |
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;
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;
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