Chinnymerlgrove
Technical User
The following sample data shows a Leave/Return from Leave job history report for 4 employees. The first column identifies which rows are the GH- Group Header and D-Detail. The data is grouped on ({PS_JOB.EMPLID}). What I need to determine on the Group Header row, is how many times in 2006 the employee was on Leave and for how many
days each time. Below each employee rows is what the result should be.
a = {PS_JOB.EMPLID}
b = {PS_NAMES.NAME}
c = {PS_JOB.EFFDT}
d = {PS_JOB.ACTION}
e = {PS_JOB.ACTION_REASON}
Sample Data
PH a b c d
GH1 EMP1 Employee 1
D1 EMP1 Employee 1 2006-04-17 PLA
D2 EMP1 Employee 1 2006-04-24 RFL
D3 EMP1 Employee 1 2006-06-26 PLA
D4 EMP1 Employee 1 2006-08-14 RFL
What the results should look like for EMP1
1st leave Period = 4/17/06 - 4/24/06 for a total of 7 days
2nd leave period = 6/26/06-8/14/06 for a total of 49 days
3rd Leave period =
Total Leave period = 56 days
GH1 EMP2 Employee 2
D1 EMP2 Employee 2 2005-07-25 PLA
D2 EMP2 Employee 2 2005-10-24 LOA
D3 EMP2 Employee 2 2006-02-13 RFL
What the results should look like for EMP2
Comment: Rows D1 & D2 are included in the calculation because the corresponding RFL row is in 2006
1st leave Period = 7/25/05 - 2/13/06 for a total of 203 days
2nd leave period =
3rd Leave period =
Total Leave period = 203 days
GH1 EMP3 Employee 3
D1 EMP3 Employee 3 2004-07-12 LOA
D2 EMP3 Employee 3 2004-08-23 RFL
D3 EMP3 Employee 3 2006-06-08 PLA
D4 EMP3 Employee 3 2006-07-03 RFL
What the results should look like for EMP3
Comment: Rows D1 & D2 are not calculated because the corresponding LOA/PLA and RFL rows are before 2006
1st leave Period = 6/8/06 - 7/3/06 for a total of 25 days
2nd leave period =
3rd Leave period =
Total Leave period = 25 days
GH1 EMP4 Employee 4
D1 EMP4 Employee 4 2005-08-22 PLA
D2 EMP4 Employee 4 2005-09-06 RFL
D3 EMP4 Employee 4 2006-01-31 LOA
D4 EMP4 Employee 4 2006-02-06 RFL
D5 EMP4 Employee 4 2006-08-28 PLA
D6 EMP4 Employee 4 2006-09-06 RFL
D7 EMP4 Employee 4 2006-09-12 PLA
2006-09-20 - Current Date
What the results should look like for EMP4
Comment: Rows D1 & D2 are not calculated because the corresponding LOA/PLA and RFL rows are before 2006
1st leave Period = 1/31/06 - 2/6/06 for a total of 6 days
2nd leave period = 8/28/06 - 9/6/06 for a total of 9 days
3rd Leave period = 9/12/06 - Current Date (9/21/06) for a total of 9 days
Total Leave period = 24 days
days each time. Below each employee rows is what the result should be.
a = {PS_JOB.EMPLID}
b = {PS_NAMES.NAME}
c = {PS_JOB.EFFDT}
d = {PS_JOB.ACTION}
e = {PS_JOB.ACTION_REASON}
Sample Data
PH a b c d
GH1 EMP1 Employee 1
D1 EMP1 Employee 1 2006-04-17 PLA
D2 EMP1 Employee 1 2006-04-24 RFL
D3 EMP1 Employee 1 2006-06-26 PLA
D4 EMP1 Employee 1 2006-08-14 RFL
What the results should look like for EMP1
1st leave Period = 4/17/06 - 4/24/06 for a total of 7 days
2nd leave period = 6/26/06-8/14/06 for a total of 49 days
3rd Leave period =
Total Leave period = 56 days
GH1 EMP2 Employee 2
D1 EMP2 Employee 2 2005-07-25 PLA
D2 EMP2 Employee 2 2005-10-24 LOA
D3 EMP2 Employee 2 2006-02-13 RFL
What the results should look like for EMP2
Comment: Rows D1 & D2 are included in the calculation because the corresponding RFL row is in 2006
1st leave Period = 7/25/05 - 2/13/06 for a total of 203 days
2nd leave period =
3rd Leave period =
Total Leave period = 203 days
GH1 EMP3 Employee 3
D1 EMP3 Employee 3 2004-07-12 LOA
D2 EMP3 Employee 3 2004-08-23 RFL
D3 EMP3 Employee 3 2006-06-08 PLA
D4 EMP3 Employee 3 2006-07-03 RFL
What the results should look like for EMP3
Comment: Rows D1 & D2 are not calculated because the corresponding LOA/PLA and RFL rows are before 2006
1st leave Period = 6/8/06 - 7/3/06 for a total of 25 days
2nd leave period =
3rd Leave period =
Total Leave period = 25 days
GH1 EMP4 Employee 4
D1 EMP4 Employee 4 2005-08-22 PLA
D2 EMP4 Employee 4 2005-09-06 RFL
D3 EMP4 Employee 4 2006-01-31 LOA
D4 EMP4 Employee 4 2006-02-06 RFL
D5 EMP4 Employee 4 2006-08-28 PLA
D6 EMP4 Employee 4 2006-09-06 RFL
D7 EMP4 Employee 4 2006-09-12 PLA
2006-09-20 - Current Date
What the results should look like for EMP4
Comment: Rows D1 & D2 are not calculated because the corresponding LOA/PLA and RFL rows are before 2006
1st leave Period = 1/31/06 - 2/6/06 for a total of 6 days
2nd leave period = 8/28/06 - 9/6/06 for a total of 9 days
3rd Leave period = 9/12/06 - Current Date (9/21/06) for a total of 9 days
Total Leave period = 24 days