Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Highlighted
Not applicable


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
Highlighted
Not applicable

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

Highlighted
Employee
Employee

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..

Highlighted
Not applicable


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

Highlighted
Employee
Employee

Joe Simmons

Spot on. I overlooked that

Highlighted
Not applicable

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

Highlighted
Employee
Employee

That works perfect.

Highlighted
Not applicable

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