Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
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
Luminary Alumni
Luminary Alumni

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.