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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
anut
Contributor
Contributor

tloop never ends

Hi,

I want tloop component to run until the count of records from MySQL component(Talend_Statistics_READ) =4 and once the condition is met, I want the remaining ETL to run.
But in my case when count =4, the loop is not ending and thereby running the remaining ETL multiple times.
I tried to modify the condition in tloop component but can't get it to work as required. When I set the condition
as ((Integer)globalMap.get("tMysqlInput_2_NB_LINE")==4), Job starts and ends immediately.
Any ideas.
Thanks,
anut
0683p000009MAub.png 0683p000009MBGq.png
Labels (2)
3 Replies
Anonymous
Not applicable

Assuming you have the correct globalMap key and the correct number of rows are being returned, it looks okay to me.
I'd check the Java code to ensure that looks okay...
while (((Integer) globalMap.get("tMysqlInput_2_NB_LINE") <= 4)) {
...
globalMap.put("tMysqlInput_2_NB_LINE", nb_line_tMysqlInput_1);
...
}
Anonymous
Not applicable

if you set ((Integer)globalMap.get("tMysqlInput_2_NB_LINE")==4), job will end immediately definitely.
because you choose while condition and set declaration globalMap.put("tMysqlInput_2_NB_LINE",0)
like
int i=0;
while (i==4)
{
//loop cant be run because the condition is false
}

and without iteration, when condition is right 0683p000009MPcz.png(Integer)globalMap.get("tMysqlInput_2_NB_LINE")<=4)
loop cant be ended
So i suggest that you should re-desgin your job...
Anonymous
Not applicable

Setting aside the i==4 issue, the original requirement looked ok, to me.
Assuming that everything I couldn't see from the Job, as good.
The while expressions look a little odd; but they should translate to what seems to be required.