Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey!
After severals minutes navigating the forum to find the answer of the problem I've met, I decided to ask for help.
I met some difficulties to load in Qlik Sense all the files contained in a folder thanks to 'Filesize' function.
So, I tried to test the file existence in a loop durinq the loading script like below:
These files names are like (file1.xlsm, file2.xlsm,...)
set a = 1;
Do while a<10
Let taille = FileSize ('\\folder\file$(a).xlsm');
If taille <>0 then
[BDD]:
LOAD
...
FROM [lib://folder/file$(a).xlsm]
(ooxml, embedded labels, table is BDD);
endif
Let a=a+1;
Loop
But in the debug mod, the var 'taille' does not return the size of the file.
I hope that I'm clear in my explanation.
Thanks for you help
(Sorry for my english)
The FileSize function also needs to use a lib reference. Unless you enable the legacy script mode. See the help file: http://help.qlik.com/sense/2.1/en-US/online/#../Subsystems/Hub/Content/Scripting/FileFunctions/FileS...
But why not use a wildcard load?
BDD:
LOAD
...
FROM [lib://folder/file*.xlsm]
(ooxml, embedded labels, table is BDD);
Actually, I don't know why I did not think about this easier solution before!
However, thanks for this information and your quick answer.
Regards