Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
NatyNu
Contributor II
Contributor II

how to validate existence of a qvd

Hello, I need to validate the existence of a file before trying to load it so that I don't get an error.
Is there any way to do it?

thank you so much!

FOR Each i IN $(vListaAños) /*2023,2024*/
FOR j =1 to 4
LET vSufijo_qvd = 'T'&j;
/*Cuando busca el COMETH_2024T2.qvd da error porque no existe aun*/
TH_FACTURACION_CONSUMO:
LOAD ....
FROM [lib://QS_GERENCIA/COMETH_$(i)$(vSufijo_qvd).QVD]
(qvd);
 
....
next j ;
NEXT i ;
Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

You don't need to check the exists of the file else just changing your loop approach by using something like this:

for each file in filelist('lib://.../file_*.qvd')

View solution in original post

5 Replies
Clement15
Partner - Creator III
Partner - Creator III

anat
Master
Master

You can use qvdcreatetime function

https://help.qlik.com/en-US/sense/November2023/Subsystems/Hub/Content/Sense_Hub/Scripting/FileFuncti...

Let Listqvdexists=isnull(QvdCreateTime('$(VAR_DIR_ETL_QVD)$(VAR_NAME_FILE_QVD).QVD'))

Use below link for incremental load for reference

https://community.qlik.com/t5/QlikView-App-Dev/Incremental-load-by-using-qvd-date/td-p/1222078

 

 

marcus_sommer

You don't need to check the exists of the file else just changing your loop approach by using something like this:

for each file in filelist('lib://.../file_*.qvd')

PhanThanhSon
Creator II
Creator II

 

Hi,

Here's a suggestion:

ErrorMode | QlikView Help

Simply set the error mode to 0 before your for statement starts,

and set it to 1 when your for statement ends.

Even if the file doesn't exist and you try to load it, you will get an error, but your script will run anyway.

Best regards Son

 

 

NatyNu
Contributor II
Contributor II
Author

You're right!! I'm going to try that. Thank you so much!!