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: 
Anonymous
Not applicable

Unable to download latest files from remote FTP folder on hourly basis

I want to download latest files from remote FTP server  where these files are pushed on hourly basis for whole day and after completion new folder for next day is created. There are 8 folders for last 8 days and I only want to get latest file from those 8 days on hourly basis.

I have deployed below logic but it is not working somehow and downloading all files instead of latest files for same hours when job is executed.

0683p000009LtL9.pngMain job0683p000009LtAI.pngtFTPFilelist properties0683p000009Lsb4.pngtFTPFileProperties configuration0683p000009Lt34.pngtSortRow Properties0683p000009Lt8d.pngtSampleRow properties0683p000009LtLY.pngtFTPGet properties

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I missed the point of tftpfilelist will already a iteration. you are right. 

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi,

 

Please use the component called tflowtoiterate just after tsamplerow before tftpget

 

In tftpget you must be mentioning the file name in the file mask

 

row4.basename+".csv"

 

I hope this should work. If it is doesn't work please send me a screen shot after you modified the job.

 

Cheers!

Gatha

 

 

 

cterenzi
Specialist
Specialist

I would be surprised if this design works for the case you described.  By iterating after tFTPFileList, the subsequent components execute once for every row returned.  So tFTPFileProperties passes one row to tSortRow, which has a very easy time sorting a single-row list which is then selected by tSampleRow and finally retrieved.

 

To find the latest dated file in the list, I'd probably pass the output of tFTPFileProperties to a tJavaRow and compare the current file's mtime to a value stored in a global variable.  If the variable is null or the incoming mtime is greater than the stored mtime, store the current row's values in variables.

 

Once the iteration is complete, start a new subjob that retrieves the filepath stored in the global variable set during iteration.

Anonymous
Not applicable
Author

I missed the point of tftpfilelist will already a iteration. you are right. 

Anonymous
Not applicable
Author

Thanks it is working now. its great.
Anonymous
Not applicable
Author

It look perfect solution,  Can you paste the solution if you have in handy or elaborate it more.

Anonymous
Not applicable
Author

It look perfect solution,  Can you paste the solution if you have in handy or elaborate it more.