Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
FabioManniti
Contributor III
Contributor III

QLIK Sense: Multiple downloads by row number

Hello, I have an app with a table with 17k rows.

I want to download it in a csv file but I would like my output to be no longer than 5k rows.

I would like to know:

is it possible to:
1) Either have multiple output file (so for 17k that would be 4 files)

2) or I can choose which rows to download (like "From 1 to 4999", "From 5000 to 9999", and so on...)

?

Thank you

Labels (1)
5 Replies
Or
MVP
MVP

I'm not aware of any way to do this natively on the front end. You could perhaps achieve this using nPrinting, though, by having multiple reports each limiting to certain rownumbers from the original table. You could also probably achieve this via script by looping through the table to load 5000 lines at a time and then store them to a file.

FabioManniti
Contributor III
Contributor III
Author

I don't really understand how to do it with a loop throught the table.

If I get it right, if I have 17k rows I should have 4 tables; but how can I show them in front end as a unique table?

Could you please give me an example of script?

Thank you

Or
MVP
MVP

In this scenario, you would not show them as one table (or at all), since you're just loading them for the sake of saving them to a CSV file. You would continue to show whatever you were showing in the first place.

Pseudoscript for the loop:

Table1:

Load *, RowNo() as RowNumber

From YourTable;

Let vStart = 1;

Let vRows = NoOfRows(Table1);

Do

Table2:

Noconcatenate Load * Resident Table1

Where RowNumber Between vStart and vStart*5000;

Store Table2 into Somefile.csv; // Note - probably best to append the variable here to generate unique file names

Drop Table Table2;

Let vStart = vStart + 5000;

Loop Until vStart > vRows ;

FabioManniti
Contributor III
Contributor III
Author

Thank you, so, if I get this straight:

In this way I will have my data downloaded in the csv file as soon as the user opens the app, because the download is in the script; am I correct?

Or
MVP
MVP

Not quite - the CSVs will be saved whenever the app is reloaded, independently of when the user accesses it.