Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
ali_hijazi
Honored Contributor

check the existence of a qvd file

Hello

I'm loading data from access database

what I want is save the data into a qvd file

I'm using the "Store" command

what I want is that to check if the qvd file doesn't exist then I store the data in the qvd file otherwise I simply load data from the qvd file already saved

thank you

3 Replies
pat_agen
Valued Contributor

check the existence of a qvd file

hi,

bookmarked this earlier today - think it does what you are after.

http://community.qlik.com/thread/28381

Not applicable

check the existence of a qvd file

Hi there,

In your  Script, you can use the filetime() function to check if a file exists.

So, for example, :

if isnull(filetime('c:\data.qvd)) then

//file doesnt exists

else

//file exists

end if

Hope this helps,

Liam

Not applicable

check the existence of a qvd file

Hi Ali,

So you want to do similiar in your Edit Script.

if isnull(filetime('d:\datadump.qvd')) then

datadump:
ODBC CONNECT TO  DataRepository;

sql
SELECT
NAME,
MONTH, 
STATUS

FROM     dbo.Data;

store datadump into datadump.qvd;

else

load * from datadump.qvd (qvd);

end if;

Now of course change your connection setting to what is appropriate to you and of course the filenames and sql select statement. They are just there for an example.

Hope this helps.

-Liam

Community Browser