create a job to get the previous row salary for the current row.if there is no previous row exists for the current row,then the previous row salary should be displayed as null?
empid   salary   previoussalary
10      1000     null
20      2000     1000
30      3000     2000      
40      4000     3000

Answer Posted / anil

1. Input file-> Transformer -> Peek
2. Keep Tranformer in sequential mode or Make partition as same
3. Two stage variables
StgPrevSalary 
StgCurrSalary

Derivations - StgVariables
StgCurrSalary- StgPrevSalary
Sal-           StgCurrSalary

Output
Emp
StgCurrSalary
StgPrevSalary

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the difference types of stages?

619


What are some prerequisites for datastage?

610


What are routines in datastage? Enlist various types of routines.

621


what should be ensure to run the sequence job so that if its get aborted in 10th job before 9job should get succeeded?

953


Name the third party tools that can be used in datastage?

607






what is stage is used for below Input columns: dept|mgr|employee|salary Output columns: mgr|count of employee per mgr|avg salary per dept note: each dept has one mgr and each mgr has many employees

657


What is developer responsibilities in UAT (user acceptance testing and Post implementation phase?

1633


how to export or import the jobs in .ISX file

710


How to manage date conversion in Datastage?

632


Explain the importance of surrogate key in data warehousing?

706


Explain ibm infosphere information server and highlight its main features?

602


what is repositery?

1289


What all the types of jobs you developed?

663


What is job control?

620


Explain entity, attribute and relationship in datastage?

629