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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
RRasti1603876642
Contributor
Contributor

Delete files older than 90 days

Hi everyone,

I need to delete the files from an archive folder which are older than 90 days. My job design is as follows:

tfilelist --> tfileproperties --> tmap --> tfilterrow --> tfiledelete.

in tmap, I'm using the diffdate function to get the difference between the current date and the mtime_string in days ("dd"). After this I need to put the logic to delete all the files which are older than 90 days, which I'm not able to. Please help!!

1 Reply
Anonymous
Not applicable

Hello,

Please try to design your work flow like:

tFileList---iterate-- > tFileProperties ---main--->tMap-------main--->tfileDelete

On tMap schema editor, you can use a condition to check mtime in expression

((TalendDate.getCurrentDate()).getTime() - (Long)row1.mtime) > (90 * 24 * 3600000) to delete files based on above condition.

Let us know if it works for you.

Best regards

Sabrina