How to get previous row value using stage variables
Posted: Sun Nov 03, 2013 10:20 am
Hello Everybody,
I have a requirement to generate previous row value where first record should populate null .
Input :
Emp_ID salary
100 1000
200 1500
300 2000
Output:
Emp_ID salary Previous_Salary
100 1000 NULL
200 1500 1000
300 2000 1500
I guess this can be performed by writing staging variables to compare the rows .
Please somebody provide me the logic to generate the stage variables
Thanks
I have a requirement to generate previous row value where first record should populate null .
Input :
Emp_ID salary
100 1000
200 1500
300 2000
Output:
Emp_ID salary Previous_Salary
100 1000 NULL
200 1500 1000
300 2000 1500
I guess this can be performed by writing staging variables to compare the rows .
Please somebody provide me the logic to generate the stage variables
Thanks