Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

How to load data from QVD when where condition is there!

Hi All,

What changes I have to do in the below script to load data from the QVD. I think instead of SQL select --> Load but other changes I don't know what to do. So please let me know what can be done.


OutStanding:

sql select
stk.c_name+' '+stk.c_code OSstockist,
rep.c_name+' '+rep.c_code OSrepname,
am.c_name+' '+am.c_code OSamname,
rm.c_name+' '+rm.c_code OSrmname,
zm.c_name+' '+zm.c_code OSzmname,
gm.c_name+' '+gm.c_code OSgmname,
s.c_depo_code OSdepot,
s.c_depo_code+'/'+s.c_year+'/'+s.c_prefix+'/'+string(s.n_srno) OSsettledocno,
s.c_depo_code+'/'+s.c_year1+'/'+s.c_prefix1+'/'+string(s.n_srno1) OSdocno,
s.n_amount OSamount,
s.d_date OSdate,
s.d_lr_date OSlrdate
from
settle_mst s
left outer join act_mst stk on s.c_cust_code=stk.c_Code
left outer join act_mst rep on stk.c_rep_code=rep.c_code
left outer join act_mst am on rep.c_rep_code=am.c_code
left outer join act_mst rm on am.c_rep_code=rm.c_code
left outer join act_mst zm on rm.c_rep_code=zm.c_code
left outer join act_mst gm on zm.c_rep_code=gm.c_code
where stk.n_type=4 and stk.n_stockist>=;
<pre>
</body>
3 Replies
MVP
MVP

How to load data from QVD when where condition is there!

Hello Rikhab,

First you need to load from a database or any other data source and store that info into QVD files. Once you have populated your QVD file, you can LOAD either using the dialog in the script editor or hardcoding your fields and conditions,

LOAD Field1, Field2 FROM FILE.QVD (QVD) WHERE Field1 = 'A';


Hope that helps

Not applicable

How to load data from QVD when where condition is there!

Yes it is done already! Got little confused that's why I posted it...

Not applicable

How to load data from QVD when where condition is there!

Rikab,

If you want to do joins at Qlikview end then load databse tables and store them separately as qvds, then fetch from a single qvd with where clause and do left / right / inner join then fetch from another qvd with where clause in this statement. Provided there must be a column with same name in both qvds.

ex.

TAB1:

LOAD

A,

B,

P
FROM XYZ.QVD

WHERE ( P = 'XYZ')

LEFT JOIN (TAB1)

LOAD

A,

C,

Q

FROM ABC.QVD

WHERE (Q = 'ABC')

You can do this before storing qvds and then store the joined tables into qvd.

Community Browser