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 data from database

Hi,

I like to load from a big table only the records with a special value (e.q. =Post_type=6). I use the load en select statement withe the where clausule and order by like:

Load *

....

select *from part

where post_type=6 order by post_type;


This works, but QV read all the rekords and it takes a lot of time. Ik would like qv to stop after read and load the records which i want.

How do i get QV to stop the load after loading the wanted record and not to read the whole table ?

3 Replies
Not applicable
Author

LOAD *;

SQL SELECT * from part Where post_type=6 order by post_type;

Should work. Since the qlikview will only execute SQL statement which will process with the condition. You confirm this from the log file.

Regards,

Kiran Rokkam.

bgerchikov
Partner - Creator III
Partner - Creator III

Hi,

I'd recommend do not use Order By clause in the load SQL statement (I'm not clear why do you need it?). Please use temporary table for initial load instead. Order By might be very costly operation on the back end side.

In addition, you might need to setup index in your DB on post_type field to speed up the process. If you cannot do this, just load everything.

Temp:

LOAD *;
SQL SELECT * from part;

NewTable:

NoConcatenate Load * Resident Temp

Where

post_type=6

order by post_type;

Drop table Temp;

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

As Kiran said, QV will only process the records that meet the where condition, but the "order by' clause could be hurting performance if the source table is large. Use Kiran's script, without the order by

LOAD *;
SQL SELECT * from part Where post_type=6
;

Also do you need all the fields in the table? If not, then it would be better to name the fields in the SQL SELECT statement, rather than using SELECT *.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein