Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
juleshartley
Valued Contributor

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');

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Loop not creating table

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

3 Replies
Not applicable

Re: Loop not creating table

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

Re: Loop not creating table

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
Valued Contributor

Re: Loop not creating table

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

Community Browser