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.
swathi_muthuru
New Contributor II

How to extract data from excel if oracle/sql server is down

Hi Experts,

I am having 2 files (Qvd and excel).The data to the Qvd is coming from Oracle server. and the Excel having the data same as Qvd.

If the Server is down the Qvd will not refreshed, then we need to take data from excel?

Please help me if possible?

Thanks in advance

Swathi

1 Solution

Accepted Solutions
kenphamvn
Contributor III

Re: How to extract data from excel if oracle/sql server is down

Hi

you can check QVD file created time

Let vQVDPath = 'lib://Desktop/DSNVMG.qvd';

Let v_last_load_time =date(QvdCreateTime('$(vQVDPath)'),'YYYY/MM/DD') ;

if v_last_load_time < date(today(),'YYYY/MM/DD') then

  //load Excel

Else

  //Load QVD

end if;

Assumption QVD file refresh one time a day and Main app reload same day with QVD file

Regards

An Pham

5 Replies
zhadrakas
Valued Contributor

Re: How to extract data from excel if oracle/sql server is down

Try someting like

Oracle:

Load A,B,C

where Date=Date(Today())

if noOfRows('Oracle') =0 Then


Load A,B,C

from Excel

ELSE

//do nothing

END IF

swathi_muthuru
New Contributor II

Re: How to extract data from excel if oracle/sql server is down

Hi Tim,

Thanks for ur reply.

For the first time reloading it will work. if the data is already there in qvd but not refreshed, in that case noofrows() will not be '0'. How to do in this case?

Thanks

zhadrakas
Valued Contributor

Re: How to extract data from excel if oracle/sql server is down

Then you want to load * from QVD right?

Oracle:

Load A,B,C

where Date=Date(Today())

if noOfRows('Oracle') =0 Then


Load A,B,C

from Excel

ELSE

//data not refreshed

Load * from QVD

END IF

kenphamvn
Contributor III

Re: How to extract data from excel if oracle/sql server is down

Hi

you can check QVD file created time

Let vQVDPath = 'lib://Desktop/DSNVMG.qvd';

Let v_last_load_time =date(QvdCreateTime('$(vQVDPath)'),'YYYY/MM/DD') ;

if v_last_load_time < date(today(),'YYYY/MM/DD') then

  //load Excel

Else

  //Load QVD

end if;

Assumption QVD file refresh one time a day and Main app reload same day with QVD file

Regards

An Pham

swathi_muthuru
New Contributor II

Re: How to extract data from excel if oracle/sql server is down

Hi Tim,

Excel is having updated data.Qvd was not updated due to server down of Oracle.

What I want is If the Qvd is not updated then need to load from excel.

Thanks

Community Browser