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 / indu

input file-->transformer--> output file

declare stage varibales
current salary
previous salary  and initialize the previous salary to null

current salary--> previous salary
previous salary->salary

in the output file derive previousalary as
previoussalary-->current salary (stage variable)

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how many rows sorted in sort stage by default in server jobs

3554


Explain the importance of surrogate key in data warehousing?

706


what is the use of materialized view?

957


What are the areas of application?

658


Which commands are used to import and export the datastage jobs?

978






What are the different types of lookups in datastage?

626


in oracle target stage when we use load option and when we use upsert option?

1748


how to achieve this output ? Two Input columns(ID & Name) - ID | Name 1 | Jack 1 | Kara In output there should be only 1 column which will be populated as - 1,Jack 1,Kara

359


How to read multiple files using a single datastage job if files have the same metadata?

735


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

643


Demonstrate experience in maintaining quality process standards?

1925


explain about citrix scheduling tool in datastage

1808


What is a ds designer?

639


Hi All , in PX Job I have passed 4 Parameters and when i run the same job in sequence i dont want to use those parameters , is this possible if yes then how

1118


Can you explain repository tables in datastage?

899