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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

check if qvd file already exist or not

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

1 Solution

Accepted Solutions
avinashelite

try like this:

QvdCreateTime('C:\MyDir\MyFile.qvd')

View solution in original post

3 Replies
swuehl
MVP
MVP

You can use one of the QV file functions to check for existence.

Command to check if a QVD file exists

Peter_Cammaert
Partner - Champion III
Partner - Champion III

IF IsNull(FileTime(QVDFilePath)) THEN // QVD File doesn't exist (yet)

:

Peter

avinashelite

try like this:

QvdCreateTime('C:\MyDir\MyFile.qvd')