Employee_Code | Office_Code | Year | Duration | Present_20Feb12 | Present_20Feb14 | X |
1 | 12 | 2011-12 | 120 | . | . | . |
1 | 12 | 2011-12 | 245 | 1 | . | . |
1 | 14 | 2012-13 | 365 | . | . | . |
1 | 167 | 2013-14 | 365 | . | 1 | . |
2 | 14 | 2010-2011 | 42 | . | . | |
2 | 13 | 2011-12 | 365 | 1 | . | . |
2 | 13 | 2012-13 | 365 | . | . | . |
2 | 13 | 2013-14 | 365 | . | 1 | 1 |
2 | 14 | 2014-15 | 66 | . | . | . |
Employee code, Office codes identify an employee and an office respectively. Duration represents the number of days for which the employee was in that particular office in the year.
Year represents period from 1 April of the current year to 31 March of the next year.
So, 2011-12 represents the period from 1 April, 2011 to 31 March, 2012.
Present_20Feb12 takes value 1 if the employee was in that institution on 20 Feb, 2012.
Present_20Feb14 takes value 1 if the employee was in that institution on 20 Feb, 2014.
I want to create a variable X which takes a value 1 if the employee was in the same office code between 20 Feb, 2012 and 20 Feb, 2014.
How do i create X ?
Please help
0 Response to Need help with coding
Post a Comment