Discussion Board for collaboration on QlikView Scripting.
I have a interesting challenge below and the question at the end.
I have a script that looks like the following:
'TableA' as Source,
'TableB' as Source,
Then I have:
Where Source = 'TableA'
STORE NewTableA into folder\NewTableA.txt(txt);
Where Source = 'TableB'
STORE NewTableB into folder\NewTableB.txt(txt);
What I would like to do is to specify for each store statement how many rows to store from each table. The number of rows to store would be specified by a user.
I imagine I will need to use a variable (e.g. vTableARows, vTableBRows etc) to store the number of rows.
But how can I integrate that into my script so that the eventual text file only stores the number of rows of data for each table?
May be something like this:
RowNo() as Count,
Where Source = 'TableA' and Count <= $(vTableARows);
Where Source = 'TableB' and Count <= $(vTableBRows);
You can try using the FIRST keyword followed by a number, or in your case the dollar expanded variable:
FIRST $(vTableARows) LOAD
FIRST $(vTableBRows) LOAD
Thanks for your suggestions.
How can I set the variables to be dynamic?
E.g. If I use vTableARows variable in the script, can I create the variable in the front end and then use an inputbox to change it's values?
Or do I have to do Set vTableARows = 10 and then use the inputbox in the front end?
You can use an input box on the front end and once a value is entered the back-end should pull only the number of rows that you have entered in your variable through the inputbox