Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
In my application there is one table which is fetching data from one qvd.but now scenario has been changed due to data overload that qvd has been splitted into different qvds year wise.Now I wanted to fetch that data from splitted qvds.
Earlier Scenario
E.g
A:
LOAD
K1,
K2
FROM .......KK.QVD;
Current Scenario
A:
LOAD,
K1,
K2
FROM.?????
Regards,
KK
celambarasansliqlikrajanNew to QlikView
suppose in a folder you have abc2001, abc2002, abc2003....abc2010. Yes, it will load all but if you have just 2001 and 2002, script will load only 2 yrs of data. so either you can keep all the qvds required in a separate folder. Like if you need to load only abc2009 and abc2010, keep only these qvd in that folder. Another approach would be -
a:
load * from abc2009.qvd (qvd)
Concatenate (a)
load * from abc2010.qvd (qvd)
you can use * or loop function to load a group of qvds. for example if you have abcfile2003, abcfile2004, and abcfile2005 in a folder you can write load * from abcfile*.qvd. This is the simplest way to load otherwise you can use loop also. Let me know if you need help on loading through loop.
Rajan
try tis way,
A:
LOAD
K1,
K2
FROM .......KK2017.QVD;
concatenate LOAD
K1,
K2
FROM .......KK2016.QVD;
HTH
In my view writing 10 different load statements and concatenating is not a great idea.
Do like this
LOAD,
K1,
K2
FROM K*qvd(qvd);
k* will load qvds starting with K
Loop code:
sub DoDir (Root)
for each Ext in 'qvd'
for each File in filelist(Root & '\abc*.' & Ext)
Temp:
LOAD Distinct [Shipment ID],
[BL/AWB/PRO],
Container,
[Container Type],
[BL Origin],
[BL Dest],
POL
FROM
[$(File)]
(ooxml, embedded labels);
Next File
Next Ext
for each Dir in dirlist (Root & '\Port Operations*.' & Ext)
call DoDir(Dir)
Next Dir
end sub
call DoDir ('path where multiple qvds stored')
remove (ooxml, embedded labels); that's for excel. Let me know if any issues you get
If I will go by abc200*.qvd approach it will load 10 years. But currently m looking for only 2 years data.
suppose in a folder you have abc2001, abc2002, abc2003....abc2010. Yes, it will load all but if you have just 2001 and 2002, script will load only 2 yrs of data. so either you can keep all the qvds required in a separate folder. Like if you need to load only abc2009 and abc2010, keep only these qvd in that folder. Another approach would be -
a:
load * from abc2009.qvd (qvd)
Concatenate (a)
load * from abc2010.qvd (qvd)
Thanks Bro,Am clear about this thing but what about below wala code when it will be usefull
Loop code:
sub DoDir (Root)
for each Ext in 'qvd'
for each File in filelist(Root & '\abc*.' & Ext)
Temp:
LOAD Distinct [Shipment ID],
[BL/AWB/PRO],
Container,
[Container Type],
[BL Origin],
[BL Dest],
POL
FROM
[$(File)]
(ooxml, embedded labels);
Next File
Next Ext
for each Dir in dirlist (Root & '\Port Operations*.' & Ext)
call DoDir(Dir)
Next Dir
end sub