Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

For Each File in Filelist - FTP load is not working?

Dear Community,

I am trying to load the .xlsx file directly from ftp server,

and i would like to use "for each" function to select the latest file in that folder,

but this function is not working, anyone could help?

script:

For each File in filelist ('[ftp://testftpname:Password@ftpaddress.com/test_*.xlsx]');Password@ftpaddress.com/test_*.xlsx]');

PS: It is working fine when i am using load from [ftp://testftpname:Password@ftpaddress.com/test_*.xlsxPassword@ftpaddress.com/test_*.xlsx]

Thanks and best regards,

Chanel

24 Replies
Colin-Albert

To load a series of xlsx files you do not need to use a for..each loop,

Just load the data from abc*.xlsx and QlikView will load and concatenate the data from each file automatically provided the data structure is the same in every spreadsheet.

Not applicable
Author

Thanks for your reply. I wan to use "for each" function is because i need to load all file in the folder and get the latest file.

Colin-Albert

Can you set a variable to the filelist expression, and see what the variable contains.

Let vFileList = filelist(...)

jonathandienst
Partner - Champion III
Partner - Champion III

Chanel

If you include a FileName() or FileBaseName() or FileTime() in your load, you will be able to identify which records come from which source file and/or when that file was last updated. Perhaps this will solve your problem.

LOAD .....

     FileBaseName() As Source,

     ....

FROM [ftp:...test_*.xlsx]


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
marcus_sommer

Loads per FTP couldn't have wildcards in path or filename. Also functions like filetime() and filelist() won't be supported from ftp-protocoll. But you could generate a full-path in a variable per algorithm or per in-listing. Alternatively you could use a triggered batch-file (execute statement) with e.g. mget --include "*.csv".

- Marcus

Not applicable
Author

Dear Colin Stuart

Filelist() looks like not a default function as it is shown in red color, i tried with FIlebaseName(), FileName() but neither is working.

Thanks,

Chanel

marcus_sommer

How above mentioned the ftp-protocoll doesn't support any file-functions or wildcards. Also I don't believe that your approach to return a proper filelist for a for each loop will generally work - I haven't seen it yet.

- Marcus

Anonymous
Not applicable
Author

Hi Marcus,

I understand ftp cannot support wildcards, but i want to load all the files from ftp, which are going to be generated 1 file every day..and these are automatically deleted for 15 days; how can I load these dynamic files from ftp into qlikview ?

Anonymous
Not applicable
Author

Hi Chanel Choo,

Did u able to load all files from FTP? if yes, could you please share sample code!!

Thanks,

Praveena