Getting Next row value and cumulative value for all i/p recs
Posted: Tue Oct 30, 2012 2:11 pm
Could you please help me out on this.
Input -
employee_id, salary
-------------------
10, 1000
20, 2000
30, 3000
40, 5000
1) Create a job to get the next row salary for the current row. If there is no next row for the current row, then the next row salary should be displayed as null.
The output should look like as
employee_id, salary, next_row_salary
------------------------------------
10, 1000, 2000
20, 2000, 3000
30, 3000, 5000
40, 5000, Null
2) Create a job to find the sum of salaries of all employees and this sum should repeat for all the rows.
The output should look like as
employee_id, salary, salary_sum
-------------------------------
10, 1000, 11000
20, 2000, 11000
30, 3000, 11000
40, 5000, 11000
Input -
employee_id, salary
-------------------
10, 1000
20, 2000
30, 3000
40, 5000
1) Create a job to get the next row salary for the current row. If there is no next row for the current row, then the next row salary should be displayed as null.
The output should look like as
employee_id, salary, next_row_salary
------------------------------------
10, 1000, 2000
20, 2000, 3000
30, 3000, 5000
40, 5000, Null
2) Create a job to find the sum of salaries of all employees and this sum should repeat for all the rows.
The output should look like as
employee_id, salary, salary_sum
-------------------------------
10, 1000, 11000
20, 2000, 11000
30, 3000, 11000
40, 5000, 11000