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

Differentiate between Join, Merge and Lookup stage?

886


What are the processing stages?

883


What are the steps needed to create a simple basic datastage job?

914


i have a job with 3 possibiliies finish with ststus ok abbort warning how do you handle these 3 in job sequence? explain the situation where you have appiled scd in your project? chandu

2515


What is the use of datastage director?

824


What is datastage engine?

972


What are orabulk and bcp stages?

909


what is 'reconsideration error' and how can i respond to this error and how to debug this

2397


what is the use of materialized view?

1244


What are the differences between datastage and informatica?

904


What is the difference between orabulk and bcp stages?

818


What is the importance of the exception activity in datastage?

873


How do u convert the columns to rows in datastage?

939


Describe link sort?

847


Differentiate between validated and Compiled in the Datastage?

960