Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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://testftpnameSmiley Tongueassword@ftpaddress.com/test_*.xlsx]');Password@ftpaddress.com/test_*.xlsx]');

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

Thanks and best regards,

Chanel

24 Replies

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

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

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

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.

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

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

Let vFileList = filelist(...)

MVP
MVP

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

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
MVP & Luminary
MVP & Luminary

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

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

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

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

MVP & Luminary
MVP & Luminary

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

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

praveenavelagap
Contributor III

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

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 ?

praveenavelagap
Contributor III

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

Hi Chanel Choo,

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

Thanks,

Praveena

Community Browser