if it's the case, or u know the name of the probably existing file, or use the *.fileextension, if u're not sure of its name
do sthing as follow:
LOAD data from the probably existingFile;
then delete what u've imported
if ScriptError>0 then
store ur Qvd
With that, what we're doing, is :
1) negating the fact that qlik stop the reloading process if there is an error
2) try to import sthing from the file that could be in ur folder (then delete it)
3) if it's there, u won't do anything
if it's not, so normally that should be an error (if ScriptError>0 then)
=> store ur qvd
I have this code at the start of my script to see if the QVD exists:
LET vListqvdexists=isnull(QvdCreateTime('lib://QVDS/DTRAK\$(vCurrentYear)\Load\StopData$(vCurrentYear).QVD')); // if qvd exists then 0 else -1
Then further down the script I check the value of this variable and then do what I need to do
That is the bulk of the code.
The variable will contain a 0 or -1.
In my script I check the variable for a 0 (meaning the QVD does exist) and then do whatever logic I want to do based on it already existing. Or I could do the opposite and check for a -1(does not exist)
We create QVDs that are year specific and have the year in the name. So when we rolled into the new year I needed to do something different on the first day since it didn't exist. After that I go back to my normal routine.