Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Employee
Employee

Retrieving data from a web file using a URL

Hi im doing a simple loop which should increment the pages in a url and give me a resultant output concatenating the results of the loop.

if I change the page number 1 at a time I can see that there is a value for each page.

when I run the loop I can see it increments through the 10 pages, however the result is just 1 line for 1 page.

loop below:

for i=0 to 10

LET $(vPage) =$(i);


summaryTable:
LOAD total_rows,
index,
PageNumber,
summaryKey  
FROM [http://test.test-api.com/testing/api/sometable.php?appid=testappid&token=someToken&page=$(vPage)]
(
XmlSimple, Table is [sometable/summary]);


Next ;

am i doing something obviously wrong here?, any pointers will be welcome

1 Solution

Accepted Solutions
Not applicable

Re: Retrieving data from a web file using a URL


Ah right sorry, change

LET $(vPage) =$(i);
to LET vPage = $(i);

and give that a try, by expanding the variable like that, it's like you are saying

Let 1 = x

and not actually changing your vPage variable and looping the same page 10 times

Joe

View solution in original post

7 Replies
Not applicable

Re: Retrieving data from a web file using a URL

looks fine, and as you say is iterating through the 10 pages. When you hardcoded in page1 did you return more than a single row?

Joe

Employee
Employee

Re: Retrieving data from a web file using a URL

if I hard code page 1 I get 1 row with the page number showing page 1 and so on for the other pages.

the  loop only returns the last page  its almost like it does not append to the first 1-9 pages..

Not applicable

Re: Retrieving data from a web file using a URL


Ah right sorry, change

LET $(vPage) =$(i);
to LET vPage = $(i);

and give that a try, by expanding the variable like that, it's like you are saying

Let 1 = x

and not actually changing your vPage variable and looping the same page 10 times

Joe

View solution in original post

Employee
Employee

Re: Retrieving data from a web file using a URL

Joe Simmons

Spot on. I overlooked that

Not applicable

Re: Retrieving data from a web file using a URL

No worries let me know if that resolves the issue when you re-run

Employee
Employee

Re: Retrieving data from a web file using a URL

That works perfect.

Not applicable

Re: Retrieving data from a web file using a URL

perfect, can you mark and close this one down then if possible, cheers