Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rrodriguesrr82
Contributor III
Contributor III

How to load multiple QVS files using Must_Include?

Hi fokls,

I have a folder with several QVS files and I want to load all them at once in Qlik Sense.

I'm trying to use must include, but I see that I have to specify the file name, that is not my purpose.

The script below works, but I added the full file name:

$(Must_Include=[lib://LATAM Qlikview Storage/IT/3.Include/Scripts/code1.qvs]);

I want to load all qvs files from a folder, but the following format does not work as it works for instance for csv files during the load script.

$(Must_Include=[lib://LATAM Qlikview Storage/IT/3.Include/Scripts/*.qvs]);

I think I have to add the Must_Include statement into a loop, but I don't really know the best practice do load all files at once using Must_Include.

Could you please help?

Tks

Rubens

Labels (1)
1 Solution

Accepted Solutions
RafaelBarrios
Partner - Specialist
Partner - Specialist

hi @rrodriguesrr82 

im afrraid that's not going to work
you will need to first recover the file list from folder

and then include one by one

something like

sub DoDir (Root)
for each Ext in 'qvs'

for each File in filelist (Root&'\*.' &Ext)

$(Must_Include=[$(File)]);

next File

next Ext
for each Dir in dirlist (Root&'\*' )

call DoDir (Dir)

next Dir

end sub

call DoDir ('lib://LATAM Qlikview Storage/IT/3.Include/Scripts')

 

could have some syntax error, couldnt tried.

Best,

View solution in original post

3 Replies
MartW
Partner - Specialist
Partner - Specialist

it is possible to loop to the qvs files and do a must include.

please take a look at the following link. example 2 might explain what you need.

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

RafaelBarrios
Partner - Specialist
Partner - Specialist

hi @rrodriguesrr82 

im afrraid that's not going to work
you will need to first recover the file list from folder

and then include one by one

something like

sub DoDir (Root)
for each Ext in 'qvs'

for each File in filelist (Root&'\*.' &Ext)

$(Must_Include=[$(File)]);

next File

next Ext
for each Dir in dirlist (Root&'\*' )

call DoDir (Dir)

next Dir

end sub

call DoDir ('lib://LATAM Qlikview Storage/IT/3.Include/Scripts')

 

could have some syntax error, couldnt tried.

Best,

rrodriguesrr82
Contributor III
Contributor III
Author

Thank you guys!!

I followed your recommendation and created the script below and worked:

For Each vs.File in FileList ('lib://LATAM Qlikview Storage/folder/*.qvs')
$(must_include=$(vs.File));
Next vs.File; vs.File=;

Tks

Rubens