Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
I need to read the names of existing files in a specific folder and load them into a table.
I solve QlikView as follows:
SET FilePath='*.qvd';
sub DoDir (Dir)
for each File in filelist (Dir&'\'&'$(FilePath)')
SET sFile = $(File);
NomFile:
First 1 LOAD
FileTime() As FileTime,
FileName() As FileName,
Left(FileName(),1) as FId,
left(Right(FileName(),12),8) as FNom
from [$(sFile)];
next File
end sub;
call DoDir ('C:\Users\Qsense');
But with Qlik Sense not working. Any suggestions?.
Regards.
Hi Sandro, in Sense you have to create a connection to a folder using the button on the right side of the script panel:
Then you can use this script:
SET FilePath='*.qvd';
sub DoDir (Dir)
for each File in filelist ('$(Dir)\$(FilePath)')
SET sFile = '$(File)';
NomFile:
First 1 LOAD
FileTime() As FileTime,
FileName() As FileName,
Left(FileName(),1) as FId,
left(Right(FileName(),12),8) as FNom
from [$(sFile)];
next File
end sub;
call DoDir ('lib://YourConecctionName\OptionalMorePath');
Hi Sandro, in Sense you have to create a connection to a folder using the button on the right side of the script panel:
Then you can use this script:
SET FilePath='*.qvd';
sub DoDir (Dir)
for each File in filelist ('$(Dir)\$(FilePath)')
SET sFile = '$(File)';
NomFile:
First 1 LOAD
FileTime() As FileTime,
FileName() As FileName,
Left(FileName(),1) as FId,
left(Right(FileName(),12),8) as FNom
from [$(sFile)];
next File
end sub;
call DoDir ('lib://YourConecctionName\OptionalMorePath');
Hola Rubén.
Funcionó perfecto, gracias.
Saludos.
Sandro.