Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
RAJ6
Contributor III
Contributor III

How to get next record values for new column?

Hi Talend Folks,

I have a date column in excel. The values are below like format. 

Input:

from_Date
09/06/2018
12/06/2018
13/06/2018
14/06/2018
15/06/2018
16/06/2018
17/06/2018
18/06/2018
19/06/2018
20/06/2018
21/06/2018
22/06/2018

I need to create to_date column and ignore first value then assign remaining values for To_date column.

This is my scenario. I need below output 

output:

from_Date To_Date
09/06/2018 12/06/2018
12/06/2018 13/06/2018
13/06/2018 14/06/2018
14/06/2018 15/06/2018
15/06/2018 16/06/2018
16/06/2018 17/06/2018
17/06/2018 18/06/2018
18/06/2018 19/06/2018
19/06/2018 20/06/2018
20/06/2018 21/06/2018
21/06/2018 22/06/2018
22/06/2018  
Labels (2)
2 Replies
Anonymous
Not applicable

You need to think about this in reverse and get the previous record to achieve this. I answered a very similar question to this here: https://community.talend.com/t5/Design-and-Development/How-to-get-previous-row-tuple-s-value-without...

 

This solution as it is will naturally lead to your first row having a null date instead of your last row. So you will have to either reverse the order of your rows before you do this and reverse them again afterwards. You can do this with a tSortRow component

David_Beaty
Creator III
Creator III

Similar to @rhalls solution, sort them into reverse order and use the tMemorizeRow component.