Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

mwallman
Contributor

How to control the amount of data exported from a QlikView application data model table?

Hi all,

I have a table in my QlikView application with approximately 300k rows of data.

This data is made up variety of tables.

E.g.

Sales

Budget

Enquiries

I have to export this data into a txt file, but the amount of data to export can vary depending on what the user wants. For example sometimes they may want 300k of data, at other times it may only be 80k, or 15k, or 290k.

How can a user set a limit on the amount of data to export?

I have a store statement below the table which exports everything, and ideally I want it to export only the number of rows a user specifies.

Any idea how to do this?

3 Replies
luciancotea
Valued Contributor

Re: How to control the amount of data exported from a QlikView application data model table?

Use a variable to control the number of rows you display.

=if(RowNo() < $(vLimit), .......)

mwallman
Contributor

Re: How to control the amount of data exported from a QlikView application data model table?

Hi Lucian,

How would this code look in an actual script?

E.g. If I am storing the data in a txt file using something like: Store TableA into location\TableA.txt(txt);

luciancotea
Valued Contributor

Re: How to control the amount of data exported from a QlikView application data model table?

So, you want the user to control the reload? I thought you make the export in the interface....

Anyway, the same logic. You don't control how many rows you export, you control how many rows you get in the table that you want to export.

Use a variable in the interface where the user specifies the number of rows.

Then, on a button press you call a macro. In this macvro, you save the doc with the new variable value and then reload the doc.

In the script, you limit the number of rows you load into the table using RonNo(). Then, export the table using STORE.

Community Browser