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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loop on URL

Hi All,

I am trying to build a loop on a specific URL. Seem like loop itself is working but I cannot retrieve the records those to be appended. Any idea or help will be greatly appreciated.

Here is the script:

FOR i = 1 to 3

Set vURLStart = '[http://www.appdata.com/leaderboard/apps?fanbase=0&metric_select=mau&page=';

Set vURLMid = $(i);

Set vURLEnd = ];

LOAD F1,

     Name,

     MAU

FROM $(vURLStart) & $(vURLMid) & $(vURLEnd)

(html, codepage is 1252, embedded labels, table is @8);

Next

Best,

Piroglu1907

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Why not try is like this:

FOR i = 1 to 3

Set vURLMid = $(i);

LOAD F1,

     Name,

     MAU

FROM [http://www.appdata.com/leaderboard/apps?fanbase=0&metric_select=mau&page=$(vURLMid)]

(html, codepage is 1252, embedded labels, table is @8);

Next i ;

Good Luck.

Dennis.

View solution in original post

9 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try with this

    

FOR i = 1 to 3

Set vURLStart = '[http://www.appdata.com/leaderboard/apps?fanbase=0&metric_select=mau&page=';

Set vURLMid = $(i);

Set vURLEnd = ']';

LOAD F1,

     Name,

     MAU

FROM $(vURLStart) & $(vURLMid) & $(vURLEnd)

(html, codepage is 1252, embedded labels, table is @8);

Next

Hope it helps

Celambarasan

Not applicable
Author

Hi Celambarasan,

Appreciated your help. But it is still the same. Script seem to be reading 120 records on 3 pages (40 records each) but retrieved data is the only first 40.

What else shall I look into?

Best,

Piroglu1907

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Did you tried with the table name before it?

    

FOR i = 1 to 3

Set vURLStart = '[http://www.appdata.com/leaderboard/apps?fanbase=0&metric_select=mau&page=';

Set vURLMid = $(i);

Set vURLEnd = ']';

TableName:

LOAD F1,

     Name,

     MAU

FROM $(vURLStart) & $(vURLMid) & $(vURLEnd)

(html, codepage is 1252, embedded labels, table is @8);

Next

Celambarasan

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi ,

I think you have defined vURLEnd incorrectly.

Set vURLEnd=']';

Hope this will work

Not applicable
Author

Hello All,

Its still not working despite adding table name and single quotation My script is as per following:

FOR i = 1 to 3

Set vURLStart='[http://www.appdata.com/leaderboard/apps?fanbase=0&metric_select=mau&page=';

Set vURLMid=$(i);

Set vURLEnd=']';

Records:

LOAD F1,

     Name,

     MAU

FROM $(vURLStart) & $(vURLMid) & $(vURLEnd)

(html, codepage is 1252, embedded labels, table is @8);

Next

Best,

Piroglu1907

Anonymous
Not applicable
Author

Why not try is like this:

FOR i = 1 to 3

Set vURLMid = $(i);

LOAD F1,

     Name,

     MAU

FROM [http://www.appdata.com/leaderboard/apps?fanbase=0&metric_select=mau&page=$(vURLMid)]

(html, codepage is 1252, embedded labels, table is @8);

Next i ;

Good Luck.

Dennis.

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

Try

Let vURLMid = $(i); instead of Set

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this script,

Set vURLStart='[http://www.appdata.com/leaderboard/apps?fanbase=0&metric_select=mau&page=';

Set vURLEnd=']';

For i=1 to 3

Set vURLMid=$(i);

LET URL = vURLStart & vURLMid & vURLEnd;

LOAD *

FROM

$(URL)

(html, codepage is 1252, embedded labels, table is @8);

Next

Regards,

Jagan.

Not applicable
Author

Hello Dennis, Celambarasan and Vijay,

Thanks for your help. Dennis' suggestion worked well as per following:

FOR i = 1 to 3

Set vURLMid = $(i);

 

LOAD F1,

     Name,

     MAU

FROM [http://www.appdata.com/leaderboard/apps?fanbase=0&metric_select=mau&page=$(vURLMid)]

(html, codepage is 1252, embedded labels, table is @8);

Next i ;

Best,

Piroglu1907