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: 
louise119
Creator III
Creator III

Script for QVD load

I want to read the QVD file, but do I have to write all the tables as follows?

Due to the large number of tables, it is difficult to list them all.
Please let me know if there is a script that uses a "for" statement or something like that.

Load * from ******(qvd);
Load * from ******(qvd);
Load * from ******(qvd);
Load * from ******(qvd);
.......
Load * from ******(qvd);

4 Replies
kleman_emark
Partner - Contributor III
Partner - Contributor III

Hi @louise119 ,

you could use the For each statement, similar as in example 2 in the following link:

https://help.qlik.com/en-US/sense/February2023/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptCont...

The logic  could be: for each file in the folder .... load Fields from Path / File.qvd

In this way you can even add metadata to each file, like FileTime, FileSize, etc.

Or you could just load all files usind the asterisk sign, as in:

https://community.qlik.com/t5/Design/Wildcard-data-loading-blah/ba-p/1467768

Hope that helps,

Tomas Kleman

vinieme12
Champion III
Champion III

 

Option 1: using wildcard *

Qualify *;

Load *  

From [Path\*.qvd](qvd);

Unqualify *;

 

Option 2: loop thru individual files

https://community.qlik.com/t5/QlikView-App-Dev/Loop-through-folder-file/m-p/1638531

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
neerajthakur
Creator III
Creator III

Hi, Do you want field names too in load script as if you get all the qvd here do Load Data then there can be Synthetic Keys and Circular References if all of them have a single key and you want all the fields, there are various ways?

Thanks & Regards,
Please Accepts as Solution if it solves your query.
neerajthakur
Creator III
Creator III

Try this if all your tables are same Field Names and in end you want them to concatenate.

for each file in filelist('lib://QVD/*.qvd')

YourTableName:

load *
from [$(file)](qvd);

next file

Exit Script;

Thanks & Regards,
Please Accepts as Solution if it solves your query.