Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error in for loop

Hi All,

     I am getting following Syntax error while fetching data by using For Loop.

My Syntax:

For Each vfilename in filelist ('Desktop\QV E books\Data\chk\*.csv')

Load *,

     '$(vfilename)' As Filename

     From[$(vfilename)];

     Next vfilename

Plz find my error screen shot as attachment

-Jay

5 Replies
Sokkorn
Master
Master

Hi Jay,

How about this script

Load

  *,

  FileName() As FileNames

From

Regards,

Sokkorn

sujeetsingh
Master III
Master III

This error points to the load you are using not the loop

Not applicable
Author

Hi Dude,

    Thank you for your reply. Your solution should work.But I need to test by using For...Next.

Thanks,

-Jay

Not applicable
Author

Hi Sujeet,

   Can you little bit more clear?What/Where I am missing

-Jay

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this

For each vFileName in Filelist ('C:\Path\*.txt')

      Load *,

         '$(vFileName)' as FileName

      From [$(vFileName)];

   Next vFileName

I think you have not give space after From in Load statement.

Regards,

Jagan.