Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Karim_Khan
Creator III
Creator III

How to fetch data from splited qvds

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

KK
1 Solution

Accepted Solutions
Anonymous
Not applicable

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)

View solution in original post

11 Replies
Anonymous
Not applicable

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

buzzy996
Master II
Master II

try tis way,

A:

LOAD

K1,

K2

FROM .......KK2017.QVD;

concatenate LOAD

K1,

K2

FROM .......KK2016.QVD;

HTH

Anonymous
Not applicable

In my view writing 10 different load statements and concatenating is not a great idea.

Not applicable

Do like this

  LOAD,

K1,

K2

FROM K*qvd(qvd);

k* will load qvds starting with  K

Anonymous
Not applicable

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

Anonymous
Not applicable

remove (ooxml, embedded labels); that's for excel. Let me know if any issues you get

Karim_Khan
Creator III
Creator III
Author

If I will go by abc200*.qvd approach it will load 10 years. But currently m looking for only 2 years data.

KK
Anonymous
Not applicable

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)

Karim_Khan
Creator III
Creator III
Author

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

KK