Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
How to write following code in Qlikview
IF Date(Today()) = YearStart(Today()
Delete all qvds where qnd name contains Year(Today())-3
Else
Don't do anything
EndIF
It's done with following code:
IF Date(Today()) <> YearStart(Today()) Then
Let QvdPath = 'D:\QlikView\Test\';
Let vYear = Year(Today()) - 3;
Let cmd = '*'&$(vYear)&'*.qvd';
execute cmd.exe /c DEL $(QvdPath)$(cmd);
EndIf
Have you tried something like this?
IF Date(Today()) = YearStart(Today()) Then
Let vYear = Year(Today()) - 3;
Let cmd = 'DEL *' & $(vYear) & '*.qvd';
execute cmd.exe /c $(cmd)
EndIf
Wher i can give the qvd path if I want to delete from specific folder only like D:\Qlikview\Qvds
Hi
execute cmd /c del "YourPath\YourFile(s)*.qvd";
Hi , Try this
Add a variabel
Set vSourcedir='D:\Qlikview\Qvds\';
Let vYear = Year(Today()) - 3;
Let cmd = '*' & $(vYear) & '*.qvd';
execute cmd.exe /c DEL '$(vSourcedir) $(cmd)'
This created below execute statement and not deletiong files from location
execute
cmd.exe /c DEL 'D:\QlikView\Test\ *2010*.qvd'
It's done with following code:
IF Date(Today()) <> YearStart(Today()) Then
Let QvdPath = 'D:\QlikView\Test\';
Let vYear = Year(Today()) - 3;
Let cmd = '*'&$(vYear)&'*.qvd';
execute cmd.exe /c DEL $(QvdPath)$(cmd);
EndIf