Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
darshan9955
Partner - Contributor II
Partner - Contributor II

How to load metadata for multiple .qvd/.qvf file in one app through data load editor.

Consider I have multiple .qvd files at one folder and no app is created in Qlik Sense desktop.

So, How can I load multiple .qvd files into my data load editor at once (using script), so that I can see metadata of the multiple .qvd files. (Manually adding .qvd files is not preferred)

11 Replies
Akash_Pohare
Contributor III
Contributor III

Hi,

Please find the script below. Please make sure when you copy the code, the indentions are perfectly matched. Here, first files are listed from a directory, and storing the file names in the variables, and then doing loop to load the files.

---------------------------------------------

sub ScanFolder(Root)

for each FileExtension in '*'

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

FileList:

LOAD '$(FoundFile)' as FilePath,

SubField(SubField('$(FoundFile)','.',-2),'/',-1) as FileName


AUTOGENERATE 1;


next FoundFile

next FileExtension

for each SubDirectory in dirlist( Root & '\*' )

call ScanFolder(SubDirectory)

next SubDirectory

end sub

Call ScanFolder('lib://ConnectionName/Folder_From_Files_To_Load/') ;

FileDetails:

LOAD * INLINE
[
1
];


LET vRecordNumber = NoOfRows('FileList');
TRACE 'Number of Records = $(vRecordNumber)';


FOR RecordNumber=1 TO NoOfRows('FileList')

LET vFileToLoadName = PEEK('FileName',RecordNumber-1,'FileList');
TRACE 'File Name to Load = $(vFileToLoadName)';

 


CONCATENATE(FileDetails)

LOAD
QvBuildNo,
CreatorDoc,
CreateUtcTime,
SourceFileSize,
"TableName",
RecordByteSize,
NoOfRecords,
Offset,
"Length",
%Key_QvdTableHeader_B94FCCAC68ED3E20

FROM [lib://ConnectionName/Folder_From_Files_To_Load/$(vFileToLoadName).qvd]
(XmlSimple, table is QvdTableHeader);

 

NEXT

DROP Field "1";

Exit Script;