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 is repositery?

1297


What is the difference between orabulk and bcp stages?

576


1)How will u implement SCD2 by using surrogate key. 2)What are the disadvantages with surrogate key. 3)How will you handle nulls in your project for the varchar, integer data types. 4)Can I use two fact tables in star schema. 5)3 jobs are running on the 2 nodes after I added one more node so can I compile those jobs to run on three nodes.

3504


What is job control?

624


Explain ibm infosphere information server and highlight its main features?

612






What is data partitioning?

745


Explain Quality stage?

671


What are the areas of application?

660


What is the difference between an operational datastage and a data warehouse?

637


Difference between server jobs & parallel jobs?

655


How can we improve the performance in datastage?

654


Define APT_CONFIG in Datastage?

666


for example You have One Table with 4 Columns (Mgr ID, Department ID, Salary, Employee ID). Can you find out the Average Salary and Number of Employee present per Department and Mgr

779


What are the main features of datastage?

662


What are datastage sequences?

672