Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
nayanqlik
Partner - Creator
Partner - Creator

Loop in qliksense

Hi,

To simplying things, assume that I have a rest connector connecting to the following url:      'https://xxxxxxxx&start=0&xxxxxxxxx'  .  If i run as is with start=0, the number of records extracted will be 100.  To extract the next 100 records, then start=100.  To extract the 3rd next 100 records, then start=200.  And so on...

Assume there is only 1 field in the data extracted call [Code]

How do I create a loop, to automatically extract the data and each extract to be concatenated with the previous extract and thereafter stored into a qvd.

Currently, there are 765 records, so the extract will only work up to start=700. However the number of records are continually increasing.   How do i account for this as well.

Kind regards,

Nayan

 

  

 

 

5 Replies
bramkn
Partner - Specialist
Partner - Specialist

for example something like this:

 

let y=0

while

let loop = (y*100)

Restconnection with start=loop

let y  = y+1

loop

nayanqlik
Partner - Creator
Partner - Creator
Author

Hi B_knuever

 

Thank you for your reply.  I've tried your script but i get an error.  In your script, are you missing any syntax's

 

kind regards

Nayan

bramkn
Partner - Specialist
Partner - Specialist

It was not a complete script. just something to get you going. lookup the while loop there are some great examples on the help page.

nayanqlik
Partner - Creator
Partner - Creator
Author

Thanks Knuever.

I've managed to find a solution.  What happen was I was getting an error where even though I had the word "next;" after the exit script.  So  i removed the word "next;", then it worked.

Kind regards,

Nayan

 

 

bramkn
Partner - Specialist
Partner - Specialist

For a while loop you need a loop. with a for each loop you need next at the end