Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I pulled below SQL table into qlikView:
StartDate | EndDate | QvdName | RefreshRequired |
5/5/2016 0:00 | 5/10/2016 0:00 | NewTrades.qvd | Y |
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'.
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.
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?
The reload of qvw is scheduled to be daily. And the qvd data should be reloaded only if the IsRefreshRequired is true.
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