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'.
Perhaps This
LOAD * FROM
[..\QVDs\QvdName.qvd](qvd) where Date<=EndDate and Date>=StartDate and RefreshRequired = 'Y';
OR
Here, What do you want to achieve the DAte
LOAD * FROM
[..\QVDs\QvdName.qvd](qvd) where RefreshRequired = 'Y';
Hi,
What is RefreshRequired is this a variable or the field
1. If it is variable then
If RefreshRequired = 'Y' Then
LOAD *
FROM
[..\QVDs\QvdName.qvd](qvd) where Date<=EndDate and Date>=StartDate;
End If
2. If it is field
LOAD *
FROM
[..\QVDs\QvdName.qvd](qvd)
where
Date <= EndDate and Date >= StartDate
and RefreshRequired = 'Y';
Regards
Anand
Anand, She don't have Date Field, How she Give the restrict for StartDate and EndDate using Date Field. Share me thiughts if you have time?
OR This also Help you
LOAD *,
Interval(Floor(EndDate - StartDate)) as Date
FROM
[..\QVDs\QvdName.qvd](qvd)
where
Date <= EndDate and Date >= StartDate
and RefreshRequired = 'Y';
Does the data from SQL will always pull one row? Would you be able to share a sample with expected output?
Yes.This table will return one row always.
I wish to load the data from QVD which lies within the date limits only when RefreshRequired flag is 'Y'
Something like this?
let vStart = peek('StartDate',0,'T1');
let vEnd = peek('EndDate',0,'T1');
let vRefresh = peek('RefreshRequired',0,'T1');
let vQVD = peek('QvdName',0,'T1');
//where T1 is the name of the table which contains those fields
If vRefresh = 'Y' Then
LOAD *
FROM
[..\QVDs\$(vQVD)](qvd) where $(vStart)<= Date and Date<=$(vEnd);
End If
This might solve your problem.
DataReload:
load * inline [
StartDate, EndDate, QvdName, RefreshRequired
5/5/2016 0:00, 5/10/2016 0:00, NewTrades.qvd, Y
];
vRefreshrequired= peek('RefreshRequired',0,'DataReload');
if '$(vRefreshrequired)'='Y' then
vQVDname= peek('QvdName',0,DataReload);
vstartdate= peek('StartDate',0,DataReload);
venddate= peek('EndDate',0,DataReload);
load *
FROM
[..\QVDs\$(vQVDname)](qvd)
where Date<=$(venddate) and Date>=$(vstartdate);
end if;
Where is the Date field here is it available into the database, Please explain bit more clear with an example or the script.
Regards,
Anand