Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load x rows from all tables

Hello,

¿Is there any way to make the in the script to load the first 100 rows from all the tables?

thank you

8 Replies
Anonymous
Not applicable
Author

Maybe you should be using RecNo ‒ QlikView and limit the values

ngreddy1982
Contributor III
Contributor III

Hi,

you can use select statement like select top 100 or load statement

table:

First 100 Load

     *

From table.csv;

Colin-Albert
Partner - Champion
Partner - Champion

If you enable debug-mode you can set a row limit of 100 which applies to all tables.

To access debug mode select "Debug" from the script editor File Menu

debug LimitedLoad.jpg

Anonymous
Not applicable
Author

i was looking instead of the debugger to write 'something' on the script.

vinieme12
Champion III
Champion III

Use First statement, see help on how to

https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/ScriptPrefixes/First.h...

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Colin-Albert
Partner - Champion
Partner - Champion

In the script you can use the FIRST N prefix before the load where N is an integer, but the first limit only applies to the next table being loaded, so you would have to add FIRST before each table.

Table1:

First 1000

load ... from ... ;

Table2:

First 500

load ... from ...;

Using the Limit in Debug mode applies the limit to ALL tables in the script.

maxgro
MVP
MVP

first ..... in a variable

SET vFirst = First 100;          // for test

//SET vFirst = ;                   

$(vFirst)

load 1 as f1

autogenerate 1000;

$(vFirst)

load 1 as f2

autogenerate 1000;

Peter_Cammaert
Partner - Champion III
Partner - Champion III

And as an extension of Massimo's technique, consider creating a document variable vDebug that enables all debug and testing measures. You can then do something like this:

IF len(trim(vDebug)) > 0 THEN

  SET vFirst = FIRST 100;

  SET vDebug = 1;

END IF

Table:

$(vFirst)

LOAD 1 AS F1

AUTOGENERATE 1000;

IF vDebug = 1 THEN

  STORE Table INTO [.\Table.qvd] (qvd); // For inspection

END IF

:

LET vFirst=;


EXIT Script;

or define a variable with parameters to embed or disable a dynamic STORE of every table you want to inspect.

Best,

Peter