Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

FOR ... NEXT and DO until - part II

Hi All,

with a help from Marco Wedel (thread) I got the below script which requests data from websites in a loop until the data is loaded (due to web server issues a load ends up with no data so needs to be loaded again). Now I need to tune the script as described below.

Links: 

LOAD * Inline [ 

Link 

http://www.rates1.com 

http://www.rates2.com 

]; 

 

LET vNoOfLinks = NoOfRows('Links'); 

FOR i=0 to $(vNoOfLinks)-1; 

LET vLink = Peek('Link',$(i),'Links'); 

LET vNoOfRowsRates = Alt(NoOfRows('Rates'),0); 

DO 

  Rates: 

  LOAD 

  [@1:n] as Data 

  FROM $(vLink) (fix, utf8); 

LOOP until NoOfRows('Rates') > $(vNoOfRowsRates); 

NEXT;

Table 'Rates' consists of sets of data from Links. Each Link set (except the last one) should have exactly 10 records including '*increase*' string. However, due to web server issue, a load from a Link happens to return less than 10 records with the string. In such cases I need to load the data again from this very Link. The last Link set may return less than 10 records and that's ok.

Any idea how to play this scenario?

Regards,

Przemek

1 Reply
Not applicable
Author

Anyone any idea, please?