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 apt_config in datastage?

926


How you Implemented SCD Type 1 & Type 2 in your project?

3905


Differentiate between datastage and datastage tx?

842


What is a datastage job?

804


How to create a file using vi editor? 2)how to delete a file in vi editor? 3)How to connect the server datastage to unix? what r the command lines we r using? 4)30 jobs r runnig in unix i want to find out my job. how to do this? give me command?

2320


im new to this tool im now at project plz tell me step by step process how to design plz help me i wnt to go with exp for job plz give me d proper design and explination

1874


What is the purpose of pivot stage and types of containers in datastage

828


Where do the datastage jobs get stored?

971


What is the difference between the local container and shared container?

870


What is a folder? Difference types of stages?

859


What are some different alternative commands associated with "dsjob"?

900


Demonstrate experience in maintaining quality process standards?

2193


Highlight the main features of datastage?

841


What are the processing stages?

862


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.

3774