Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Contributor II

Loop to total rows


I have a table which I retrieve in JSON format. This works with a skip and take function, so in a loop I change the skip to be able to loop through the table.

My problem is the To part of the loop. Because the take has a 5000 record limit if I use a function like NoOfRows('Table') it stops after the first loop because it sees the 5000. What I can use to let the loop run to 22.000 (which is now the number of records in the table)?

Regards, Paul

5 Replies
Valued Contributor III

Re: Loop to total rows

Not sure if this gonna help but can you use rowno() and get its maximum value stored in a variable or use it directly?

Contributor II

Re: Loop to total rows

What would I need to do to try this suggestion?

Re: Loop to total rows

It sounds that it might be solvable with another loop which sliced your input-table. There you could add a counter maybe with something like:

ceil(rowno() / 5000) as LoopCounter

and then you could loop through this field like:

for i = 1 to fieldvaluecount(LoopCounter)


     load * from Table where LoopCounter = $(i);

     ... your other stuff ...


- Marcus

Contributor II

Re: Loop to total rows

Problem is I need tot loop to load the whole table since the source only allows me to get 5000 records at once.

So in order to load all records I need a loop statement, but in order to make the loop statement I need all records. So that is what I am sort of stuck in now.

Re: Loop to total rows

Sounds like you need to look at pagination - here is the url of to the loading paged data manual section


The actual details of what you precisely need to do will depend on the details of your data source.

Community Browser