Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
juleshartley
Specialist
Specialist

Loop not creating table

Hi All,

I've obviously missing something obvious here! i have this loop, which is meant to cyle through qvw's stored in a certain directory and return simple file information... however it is not returning a table at all. I have debugged and it steps through the files but no table 'Data' is created!

SET FilePath='*.qvw';

sub DoDir (Dir)

for each File in filelist (Dir&'\'&'$(FilePath)')

SET sFile = $(File);

Data:

Load 'Test' as FileName;

next File

end sub

//Call the procedure "DoDir" to check for files in this directory.

call DoDir ('D:\Work\Reference');

1 Solution

Accepted Solutions
Not applicable

Try sth like:

LOAD $(File) as FileName

AUTOGENERATE 1;

You always need a source (a file, a database) or Autogenerate N to populate a table

Fabrice

View solution in original post

3 Replies
Not applicable

Try sth like:

LOAD $(File) as FileName

AUTOGENERATE 1;

You always need a source (a file, a database) or Autogenerate N to populate a table

Fabrice

Not applicable

Try using the below script.

SET FilePath='*.qvw';

sub DoDir (Dir)

for each File in filelist (Dir&'\'&'$(FilePath)')

SET sFile = $(File);

Data:

Load 'Test' as FileName

       AUTOGENERATE 1;

next File

end sub

call DoDir ('D:\Work\Reference');

juleshartley
Specialist
Specialist
Author

Thanks both - I knew it would be something like that!