Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ?
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.
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,
Thanks Jagan. It is working..
Great
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;
thanks pradeep.
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;