Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
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
Anil_Babu_Samineni

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';



Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
its_anandrjs

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


Anil_Babu_Samineni

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';

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Does the data from SQL will always pull one row? Would you be able to share a sample with expected output?

pooja_sn
Creator
Creator
Author

Yes.This table will return one row always.

pooja_sn
Creator
Creator
Author

I wish to load the data from QVD which lies within the date limits only when RefreshRequired flag is 'Y'

ionutbos
Contributor
Contributor

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


Anonymous
Not applicable

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;

its_anandrjs

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