Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
markella92
Contributor
Contributor

how load QVD file only if it has records otherwise not

Hi guys, how can i load QVD file only if QVD has records?

THANKS

Labels (2)
5 Replies
mrybalko
Creator II
Creator II

ignacio_pena
Contributor III
Contributor III

Hi Markella92,

You Could try the next option:

if filesize('NAME_QVD.qvd') > 0 then

TABLE1:
LOAD
A,
B,
C
FROM
NAME_QVD.qvd
(qvd);

else

/*In this part you should put what happens if you do not load the qvd. For example load table from database */

TABLE1:
LOAD
A,
B,
C
;
SQL SELECT A, B, C
FROM TABLE_BBDD;

end if

A greeting,

 

"

markella92
Contributor
Contributor
Author

i use QvdNoOfRecords() with IF-ELSE statement?
markella92
Contributor
Contributor
Author

how can i stop execution in ELSE statement? with exit script? and can i show a pop up with a message?
ignacio_pena
Contributor III
Contributor III

Hi,

If you put "exit script" the script it will end. You can put:

Else 

exit script

end if

....and continue with the rest of the script or finish the reload with other exit script.

If  what you need is to trace the code it is best to put in debug mode:

https://help.qlik.com/en-US/sense/November2018/Subsystems/Hub/Content/Sense_Hub/LoadData/debug-data-...