How to get next record values for new column?

Eight Stars RAJ
Eight Stars

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  
Thanks
RAJ
Community Manager

Re: How to get next record values for new column?

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

Nine Stars

Re: How to get next record values for new column?

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

Regards David
Dont forget to give Kudos when an answer is helpful or mark the answer as the solution.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch