Input:
employee_id, salary
-------------------
10, 1000
20, 2000
30, 3000
40, 5000
output:
employee_id, salary, next_row_salary
------------------------------------
10, 1000, 2000
20, 2000, 3000
30, 3000, 5000
40, 5000, Null
I need a Datastage job to get this output.
Logic needed
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
Re: Logic needed
couple of years before, this logic was asked in an interview to me!!
Fine you can sort the data in desc and use stage variable in the TFM
Fine you can sort the data in desc and use stage variable in the TFM
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Logic needed
can you please give tell me how to use the stage variable in the transformerSURA wrote:Fine you can sort the data in desc and use stage variable in the TFM
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Re: Logic needed
You really need to read the documentation of transformer and stage variables first.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.![Wink :wink:](./images/smilies/icon_wink.gif)
Genius may have its limitations, but stupidity is not thus handicapped.
![Wink :wink:](./images/smilies/icon_wink.gif)
So you haven't used stage variables yet? Do you have any experience with other ETL tools? They are variables that are local to the transformer and are (for all practical purposes) identical to variable ports in Informatica, if that helps at all.
If it doesn't, is there anyone you work with who could give you a quick tutorial? Otherwise, as noted, they are discussed in the Defining Local Stage Variables section of the Parallel Job Developer's Guide (parjdev.pdf in your version).
If it doesn't, is there anyone you work with who could give you a quick tutorial? Otherwise, as noted, they are discussed in the Defining Local Stage Variables section of the Parallel Job Developer's Guide (parjdev.pdf in your version).
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers