Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
manojkulkarni
Partner - Specialist II
Partner - Specialist II

Load Multiple QVDs

Good Morning Friends,

I have set of QVDs having data from same table, but column structure of qvd's are different. Few of QVDs has 10 columns & few has 15 columns. First 10 columns are same in both cases & later 5 columns being added to new data. For Historic data , structure didn't changed. Here my question is how to load all of them into a single QVD ?


Labels (1)
15 Replies
manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

Hi Balraj,

Thanks for your reply.

I mean set of QVD's are coming from multiple tables. Multiple tables are generated to hold big data set, few of the tables structure got changed due to addition of columns but the old one's where data is already present remains same. That's why concatenate logic will not work directly.

PrashantSangle
MVP
MVP

Hi,

try below script.

Data:

Load *

From Temp\QVD1.qvd;

concatenate

Load *

From New\*.qvd;

Note : To avoid duplicate of 1 st QVD you can place it in different folder and other QVD in different folder.

           If you kept QVD1 in same folder it include duplicates of 1st QVD.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

Thanks Jagan. It is working..

Great

PradeepReddy
Specialist II
Specialist II

you can try like this also...

Let vFolder_Path='D:\Qlik_199478';

// Reads all file names in a folder with the extension '.qvd'

sub ScanFolder(Root)

     for each FoundFile in filelist( Root & '\*.QVD')

              FileList:

              LOAD * inline

              [

              SourceFile,

              $(FoundFile),

              ];     

      next FoundFile

end sub

Call ScanFolder('$(vFolder_Path)') ;

let vNoOfQVD=NoOfRows('FileList');

Set vConcatenate = ;

//Reading the data from all QVD files

FOR var_i = 1 TO $(vNoOfQVD)

  vSourceFile = trim(PEEK('SourceFile', var_i-1, 'FileList'));

  Final:

  $(vConcatenate)

  load *,

  Filebasename() as QvwFile

  from $(vSourceFile)(qvd);

  Set vConcatenate = Concatenate;

NEXT var_i;

drop table FileList;

manojkulkarni
Partner - Specialist II
Partner - Specialist II
Author

thanks pradeep.

Kushal_Chawda
MVP
MVP

one more way

Data:

LOAD * Inline [

Temp ];

for Each vFile in FileList('D:\Kushal\Test\*.qvd');

Concatenate(Data)

LOAD *,

FileBaseName() as FileName

From $(vFile)(qvd);

NEXT vFile

DROP Field Temp;