Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load previous day data as a start data for the next day in Talend

Hi Team,

 

I am trying to design a job which will capture Daily power readings. The input file contains data of the daily readings for different power reading meters. The readings of the output have to be updated as the start data and end data .The readings of the previous day reading of a meter should be loaded as start date for that meter for the next day. and the readings will be loaded directly as end data

ie 

INPUT
Meter_Name  Date readings
A 20/10/2019 100
B 20/10/2019 150
A 21/10/2019 300
B 21/10/2019 250

 

 

the expected output is 

Meter_Name Date Start Data End Data
A 20/10/2019   100
B 20/10/2019   150
A 21/10/2019 100 300
B 21/10/2019 150 250

 

Please suggest a method to implement this logic in Talend  job.

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

    Its very easy with Talend. Please refer the below screenshots.

0683p000009M7ik.png

 

0683p000009M7qi.png

 

You need to read the same file twice for main and lookup flow. In the lookup join condition, you need to join based on meter name and date -1. The function for date -1 is as shown below.

 

TalendDate.addDate(row1.reading_date,-1,"DD") 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

 

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi,

 

    Its very easy with Talend. Please refer the below screenshots.

0683p000009M7ik.png

 

0683p000009M7qi.png

 

You need to read the same file twice for main and lookup flow. In the lookup join condition, you need to join based on meter name and date -1. The function for date -1 is as shown below.

 

TalendDate.addDate(row1.reading_date,-1,"DD") 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

 

Anonymous
Not applicable
Author

Thanks @nthampi . It worked for me.