Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello the community,
I am using an incremental load in my script to load new data from an excel spreadsheet that is downloaded weekly.
Basically my script is divided in 3 parts
1) Initial load
TRACE $(vDiv);
//********************************************
// Initial Load - Creation of Timekeeping_Summmary.qvd
//********************************************
Data_ABC:
LOAD
[LAST NAME],
[FIRST NAME],
SHIFT, ,
[PAY CODE],
[Activity Type],
HOURS,
WORK_DT
FROM
[$(RootDir_Data_ABC)Timekeeping_Summary.xls]
(biff, embedded labels, table is Sheet1$);
STORE Data_WBS into $(RootDir_QLIKMART) Timekeeping_Summary.qvd (QVD);
2) Incremental load
TRACE $(vDiv);
//********************************************
// Incremantal Load - look for new data to add
//********************************************
Incremental:
NoConcatenate
LOAD
[LAST NAME],
[FIRST NAME],
SHIFT, ,
[PAY CODE],
[Activity Type],
HOURS,
WORK_DT
FROM
[$(RootDir_Data_ABC)Timekeeping_Summary.xls]
(biff, embedded labels, table is Sheet1$);
Where WORK_DT >= $(vUpdateDate);
3) Concatenante
TRACE $(vDiv);
//********************************************
// merge new data
//********************************************
Data_ABC:
LOAD
[LAST NAME],
[FIRST NAME],
SHIFT, ,
[PAY CODE],
[Activity Type],
HOURS,
WORK_DT
FROM
$(RootDir_QLIKMART)Timekeeping_Summary.qvd (QVD)
Where not Exists (WORK_DT);
STORE Incremental into $(RootDir_QLIKMART)Timekeeping_Summary.qvd (QVD);
Drop table Incremental;
Right now, I run the inital load only once to create the main QVD and then I put in comment this part of the script because I dont need it anymore.
I would like to replace that process with something like: IF the initial qvd has been created, go to step 2 direclty, if not, create it.
If I let these 3 steps all together run after the other, the script fails, thats why I'm looking for something like "run only if"
If you have any idea...
Thank you
You can use one of the QV file functions to check for existence.
IF IsNull(FileTime(QVDFilePath)) THEN // QVD File doesn't exist (yet)
:
Peter
try like this:
QvdCreateTime('C:\MyDir\MyFile.qvd')