Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
pooja_sn
Contributor

Re: Script

I have a QVD stored - NewDesks.qvd which has a column 'Date'.

I have another table in SQL database which has only 1 row with 4 columns - StartDate, EndDate, QVDName, IsRefreshRequired.

I need to load only those records from QVD having Date between StartDate and EndDate which are specified in above SQL table. And the load statement should execute only if IsRefreshRequired column from database has 'Y' value.

qlikdeez
Valued Contributor

Re: Script

Just to understand this better...

Does the reload of the qvw have to be kicked off automatically when there is a refresh required for new records?

Or do you reload the qvw every min/hour/day etc. and during these scheduled reloads, it needs to check for the required reload records?

pooja_sn
Contributor

Re: Script

The reload of qvw is scheduled to be daily. And the qvd data should be reloaded only if the IsRefreshRequired is true.

qlikdeez
Valued Contributor

Re: Script

Try this:

Edit the path and add in your date filters on the qvd load...


Control_table:
LOAD * INLINE [
StartDate, EndDate, QvdName, RefreshRequired
5/5/2016, 5/10/2016, NewTrades.qvd, Y
]
;


IF match(trim(peek( 'RefreshRequired', 0, 'Control_table' )),'Y') then

Mytable:
LOAD *
FROM
Path...\NewTrades.qvd
(
qvd);

ELSE

TRACE Refresh not required;

ENDIF