Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
pooja_sn
Creator
Creator

Script

Hi,

I pulled below SQL table into qlikView:

   

StartDateEndDateQvdNameRefreshRequired
5/5/2016 0:005/10/2016 0:00NewTrades.qvdY

How can I write the script to load data from this qvd like


LOAD *
FROM
[..\QVDs\QvdName.qvd](qvd) where Date<=EndDate and Date>=StartDate;

and execute this load statement only when RefreshRequired is 'Y'.

13 Replies
pooja_sn
Creator
Creator
Author

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
Specialist
Specialist

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
Creator
Creator
Author

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

qlikdeez
Specialist
Specialist

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