I have a table like
Now, I want the output to be like:
surr_key, item_id,item_name, parent_id
Here, surr_key is auto_increment and parent_id is the surr_key of precious row for the same item_id.
a is the first item for item_id=1 thus it will be -1 and same with x.
Can anyone help how to achieve it ?
This post answers a slightly different question, but you can use the method to do what you want. Essentially you are looking at the functionality which means that tMap variables are actioned in order from top to bottom and they preserve their values between rows.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Pick up some tips and tricks with Context Variables
Learn how media organizations have achieved success with Data Integration
Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend