
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Load Script If File Exists
i have 20 load scripts and after each load table I generate one text file. So If every load script runs properly 20 files will be created.
Now what i want is to implement a solution where from the next time onwards those load scripts will only run if corresponding text file is present in the file path. Please help how to code the same?
Like below:
if( text file1 exist in file path) THEN
LOAD Table 1
END IF
if (text file 2 exist in file path) THEN
LOAD Table 2
END IF
if(text file 3 exist in file path) THEN
LOAD Table 3
END IF
.
.
.
if(text file 20 exist in file path) THEN
LOAD Table 20
END IF
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could do something like this:
set dir = C:\Projetos\Qlik\1.Apps\1.Extract_Transform_Automatization;
if (FileSize('$(dir)\a.txt')>0) then
[a]:
LOAD @1
FROM
[C:\Projetos\Qlik\1.Apps\1.Extract_Transform_Automatization\a.txt]
(txt, utf8, no labels, delimiter is '\t', msq);
endif;
That will only load if the file exists and has a size greater than 0kb.
Just repeat the same code for the others and you'll have roughly what you need.
I'd take another approach, but it'd require the DoDir() function from QDF (https://github.com/QlikDeploymentFramework/Qlik-Deployment-Framework)
to check which file exists or not.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could do something like this:
set dir = C:\Projetos\Qlik\1.Apps\1.Extract_Transform_Automatization;
if (FileSize('$(dir)\a.txt')>0) then
[a]:
LOAD @1
FROM
[C:\Projetos\Qlik\1.Apps\1.Extract_Transform_Automatization\a.txt]
(txt, utf8, no labels, delimiter is '\t', msq);
endif;
That will only load if the file exists and has a size greater than 0kb.
Just repeat the same code for the others and you'll have roughly what you need.
I'd take another approach, but it'd require the DoDir() function from QDF (https://github.com/QlikDeploymentFramework/Qlik-Deployment-Framework)
to check which file exists or not.
