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: 
_AnonymousUser
Specialist III
Specialist III

Subtracting a value from a previous row

Good day all
I have records in my database that are updated every 10 seconds, the values accordingly increase with time. I need to calculate the difference between the two values and then write the result to another table. Does anyone have any idea how this could be accomplished. Any thoughts in this regard would be sincerely appreciated.
Regards
Brian
Labels (2)
2 Replies
Anonymous
Not applicable

Hi,
I think you are looking for " incremental load"(capture the changed data and only load these changed data into target table).
For community version, if there is not too much data, you might consider using a tMap which inner joins existing data with all data and then have an output which catches the reject of inner join.
For enterprise subscription version, Talend provide CDC(Change Data Capture) function. Please see the related reference:
tMysqlCDC
Best regards
Sabrina
alevy
Specialist
Specialist

tInfiniteLoop -iterate-> tInput --> tJavaRow --> tOutput
In tJavaRow:
1. subtract the latest value from the previous value (stored into a variable)
2. store the new value for next time
3. modify the SQL used in the input for next time
4. send the new data for the other table