Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I'm guessing this has been covered already.
I am loading a rather large amount of data in to Qlikview (via some QVD's) and then creating a number of variables and then performing a number of Qlikview functions to create my Data model. The load takes up to about an hour each time.
I was wondering if there is a way to Test my code works with a small amount of data from the various data sources before I perform the full reload? Thus preventing waiting 45 mins for it to fail and then having to find out what I did wrong before attempting to load the data again.
Any easy way to do this - that I have missed?
You could do a limited load in the Debug mode.
1. Go to the Script editor
2. Click on Debug
3. On left hand side you'll see a tick box labelled Limited Load, select it
4. In the number below type in the number of records to load for each table (default is 10)
5. Click Run
This will only load the number of records specfied. If it is set to 10, only 10 records of every table will be loaded.
The easiest way is to add where conditions in the load , something like date = today() or customer_code = 'xxx'
something to reduce data amount.
Otherwise you ca load each table and store it in a qvd (only once) then reload during test time the qvd and this will consume less time
Thanks for this reply - however it isn't really practical as the number of where clauses I would need to add would be quite a lot of work to keep changing each time. The second suggestion would mean having to write different code. I'm sure there must be a more eloquent solution.
You could do a limited load in the Debug mode.
1. Go to the Script editor
2. Click on Debug
3. On left hand side you'll see a tick box labelled Limited Load, select it
4. In the number below type in the number of records to load for each table (default is 10)
5. Click Run
This will only load the number of records specfied. If it is set to 10, only 10 records of every table will be loaded.
you can use First function
Table:
First 10 LOAD * FROM abc.csv;
if you define a variable with First N , you have to change that only in one place
Same method forl SQL: for sql server define a variable with TOP N, .....
This is what I do.
Create a variable vTest, acceptng integervalues
In the begenning of the script
IF vTest = 0 THEN
LET Limit = '';
ELSE
LEt Limit = 'First ' & vTest;
And, at the beginningof each load, add this:
$(Limit)
Now you can ste vTest to 0 before relaod for all records, or set it to any aothe number to load the limited number of records.
Many Thanks - exactly what I was looking for!
The biggest problem when you use limit, first etc. is that you cannot test your objects on an omogeneous set of data because if you need to verify an expression probably you yet know a certain sum for a certain dimension by customer, date , week or something else.
If you load only a few rows certainly you may verify the layout but it is difficult to check expressions
This is correct. Limited load is good only to test the script syntax. And there could be situation that it is data-sensitive and limited load may behave differently. But even so, it does save a lot of time if the full reload is too long.