Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Empty Files

We currently load multiple files from a directory into a single QVW file but periodically we get sent empty documents from our customer.  Unfortunately when the file is empty half the columns are missing and load load process fails, is there anyway to tell QlikView to ignore these files during the load process? 

I have already confirmed these files are always 512bytes in size and actually tried the following but it still seems to load the entire file and then fail:

Load   Field1,

          Field2,

          Field3,

          Filed4

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq)

Where FileSize()>768;

1 Solution

Accepted Solutions
danielrozental
Master II
Master II

Why don't you use "for each" and test the filesize before doing the load?

View solution in original post

5 Replies
danielrozental
Master II
Master II

Why don't you use "for each" and test the filesize before doing the load?

Anonymous
Not applicable
Author

How would I use For Each? I like the idea but can't see the syntax to use a condition such as Where FileSize() in conjunction with For Each.

danielrozental
Master II
Master II

for each file in filelist('*.txt')

     if filesize(file) > 768 then

        LOAD ...

Anonymous
Not applicable
Author

Thanks Daniel, that's what I was looking for.

rajni_batra
Specialist
Specialist

Daniel

i have the path

LET Filename='C:\Documents and Settings\5481\Desktop\Importdatafromsharepoint\Rev Call Summary Sheet_'&$(a)&'.xlsx';

and excel comes on weekly basis on random day.

so i want a daily reload how can i implement this using for each loop?