Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Good Morning..!!
We have requirement like deleting the qvw files in the folder structure with few of QVW files needs to excepted and keep the last 2 years files and rest of the old/Backup QVW files need to deleted.
folder structure :
1.Apps
1.SE
AA (Folder Name)
Backup (Folder Name)
.qvw (files)
BB (Folder Name)
Old(Folder Name)
.qvw (files)
CC (Folder Name)
Backup(Folder Name)
.qvw (files)
2.DK
3.No
2.Data
3.Strings
4.Files
We have written the below script for deleting the QVW files in Old/Backup folders.
sub DoDir (Root)
for each Dir in dirlist (Root&'\*' )
IF (WildMatch('$(Dir)', '*\Backup*', '*\OLD*')) THEN
TRACE Will remove $(Dir);
EXECUTE cmd.exe /C rmdir /s /q $(Dir);
ENDIF
Dir:
LOAD
'$(Dir)' as Dir
AutoGenerate(1)
;
call DoDir (Dir)
next Dir
end sub
call DoDir ('1.Apps')
Directories:
LOAD
*,
IF(WildMatch(Dir, '*Backup*', '*_OLD*'), 1, 0) as IsBackup
Resident Dir
;
DROP TABLE Dir;
This is not really something QlikView is designed for, would likely recommend you use a PowerShell script and launch that via Publisher Support Task and External Program task to do the clean-up etc., that should be a much cleaner solution, but would allow you to control it from the Publisher side etc.
Regards,
Brett