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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
schwarben
Contributor
Contributor

Flushing tHashOutput after an Iterate

Hi,

I am currently using tHashInput components in an iterate loop, and I wonder if there is a preferred way of flushing the hash when done.

I tried to summarize my problem in a toy exemple :0693p000008vhDBAAY.png

As depicted in the figure, a first tHashInput is used to read the data and derive categories (They are simply distinct values of a given column). I then iterate through all categories and apply various processes (here a simple tLogRow). To do that, at the begining of each loop I read the data from the hash and filter the rows to extract the current category.

Obviously, I cannot flush the hash before I iterated through all categories. I thus need to add another tHashInput when it's done. And apparently a lonely tHashInput cannot perform the flush, therefore I had to add an empty tJavaRow to consume the data and let the tHashInput perform the flush.

It seems a bit overkill to have to read the data again in order to be able to flush, therefore I wonder if there is a better way to perform this action.

Any help or advice on the subject is welcome.

Thanks

Labels (2)
1 Reply
David_Beaty
Specialist
Specialist

Hi,

 

You've pretty much got what's required - a final tHashInput that has the flush option set, passing it to a solitary tJavaRow.

 

As a guide, any components that have a dropdown/tickbox/radio button within them using that option tangibly changes how Talend will render the code in the background. So, its not as if you could detect when you're on the last iteration and flush.

 

Thanks

 

David