Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
We have 3 towers, which contains QVD folders and Sub folders within QVD folders.
I am able to fetch metadata of QVD's using the below script for one tower, however i need to write a script which will loop through all 3 towers of QVD and its Sub folders. Note: xxxxxx will remain same for all the 3 towers.
Example : Tower one : \\xxxxxx\AAA\QVD\
Tower two : \\xxxxxx\BBB\QVD\
Tower three : \\xxxxxx\CCC\QVD\
Script:
Set vConcatenate = ;
sub ScanFolder(Root)
for each FileExtension in 'qvd'
for each FoundFile in filelist( Root & '\*.' & FileExtension)
let vFileName = mid(FoundFile, index(FoundFile, '\', -1) + 1, 99);
QvdFields:
LOAD
'$(vFileName)' as QVD_Name,
FieldName as Column_Name,
'$(FoundFile)' as SourceFile
FROM [$(FoundFile)] (XmlSimple, Table is [QvdTableHeader/Fields/QvdFieldHeader]);
QvdTableHeader:
LOAD
CreatorDoc as QVW_Path,
mid(CreatorDoc, index(CreatorDoc, '\', -1) + 1, 99) as QVW_Name,
Date(CreateUtcTime, 'DD/MM/YYYY') as Created_Date,
Year(CreateUtcTime) as Year,
Month(CreateUtcTime) as Month,
Day(CreateUtcTime) as Day,
TableName as Table_Name,
'$(FoundFile)' as SourceFile
FROM [$(FoundFile)] (XmlSimple, Table is [QvdTableHeader]);
Set vConcatenate = Concatenate;
next FoundFile
next FileExtension
for each SubDirectory in dirlist( Root & '\*' )
call ScanFolder(SubDirectory)
next SubDirectory
end sub
Call ScanFolder('\\xxxxxx\AAA\QVD\') ;
Not sure if this will be of help or not, but it is along the lines of what you are doing, so hopefully it will, post from the Design Blog area:
https://community.qlik.com/t5/Qlik-Design-Blog/Loops-in-the-Script/ba-p/1473543
Regards,
Brett