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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

how to capture last row

I have a Talend job that generates sequence values. So for each row, the value of the column "key" increments 1, 2, 3, 4,... n.
I need to capture the last value (n) and store it in a database table. What is the best way to do that?
In Kettle you would use the Blocking step for this.
Thanks
Geoffrey
Labels (2)
3 Replies
Anonymous
Not applicable

Hello
Define a context var, let's calle it: lastValue, add a tJavaRow in your job and type in, for example:
output_row.id=input_row.id;
output_row.name=input_row.name;
context.lastValue=context.lastValue+1;
the value of var will add 1 when each row pass on tJavaRow and finally stroe it into db.
Best regards

shong
_AnonymousUser
Specialist III
Specialist III
Author

Hi,
Although this is a very post, I have the same issue. I am trying to transfer an ETL transformation from Spoon to Talend and I am trying to find a workaround to implement what the Blocking Step of Spoon does which is basically it blocks until all rows have been processed and all subsequent steps receive the last input row to this step.

The workaround with introducing the lastValue variable is a way to count the rows processed but how I can block the execution until all rows have been processed and pass only the last row?
Is there any equivalent step?
Thank you.