Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP 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
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';



Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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';

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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