Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I want to create from the folder FolderA with path (N:\Dashboard\FolderA) a list with the subfolders of FolderA (also FolderA1, FolderA2,FolderA3).
The desired output then:
FolderA |
FolderA1 |
FolderA2 |
FolderA3 |
Any help please?
Thanks in advance
Best regards
Try this:
LET vRootPath = 'C:\Temp\FolderA\';
For each vSubFolder in DirList('$(vRootPath)*')
LOAD
Mid('$(vSubFolder)', 1+ len('$(vRootPath)')) as FolderA
AutoGenerate 1;
next vSubFolder
You can create folders with qlikview by execute statements.
Try a script like this:
LET vRootPath = 'N:\Dashboard\FolderA\';
FOR each vSubFolder in 'FolderA1', 'FolderA2'
Execute cmd.exe /C mkdir $(vRootPath)&$(vSubFolder);
next vSubFolder
PS: you might need to adjust your settings to allow the script to run write and execute statements.
Hi Vegar,
thank you for your prompt response.
I want actually to create a field from already existed FolderA.
FolderA exists with the path 'N:\Dashboard\FolderA'. Its subfolders exist as well and are FolderA1 and FolderA2.
I want just to create a field with the name FolderA and with field values FolderA1 and FolderA2.
Thank you in advance.
Try this:
LET vRootPath = 'C:\Temp\FolderA\';
For each vSubFolder in DirList('$(vRootPath)*')
LOAD
Mid('$(vSubFolder)', 1+ len('$(vRootPath)')) as FolderA
AutoGenerate 1;
next vSubFolder
Perfect!