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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ksharpes
Creator
Creator

Add filenames from Folder into Table

I want to add the filenames from a folder into a table so i can loop through them to pull the data from them.

I have searched through a number of posts but none seem to work.

Any suggestions?

The folder is called "Jedox_Data"

I would expect it to be something like the below

for each file in filelist('lib://Jedox_Data/*.xlsm')

Filelist:

load

'$(file)' as Filename;

next file

 

 

 

 

 

1 Solution

Accepted Solutions
Anil_Babu_Samineni
MVP
MVP

May be like this?

sub DoDir (Root)
      for each Ext in 'xlsm'
          for each File in filelist (Root&'\*.' &Ext)
              LOAD
              '$(File)' as FileName
              autogenerate 1;
          next File
      next Ext

      for each Dir in dirlist (Root&'\*' )
          call DoDir (Dir)
      next Dir
end sub

call DoDir ('lib://Jedox_Data') // Here, I assume that "Jedox_Data" is the connection name of that folder path

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

1 Reply
Anil_Babu_Samineni
MVP
MVP

May be like this?

sub DoDir (Root)
      for each Ext in 'xlsm'
          for each File in filelist (Root&'\*.' &Ext)
              LOAD
              '$(File)' as FileName
              autogenerate 1;
          next File
      next Ext

      for each Dir in dirlist (Root&'\*' )
          call DoDir (Dir)
      next Dir
end sub

call DoDir ('lib://Jedox_Data') // Here, I assume that "Jedox_Data" is the connection name of that folder path

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful