Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

livio218526
Contributor

Upload all filename in a path

Hi Everyone,

I need to load all file name in a Path that I have set like a variable.

I try to use this code, but it doesn't fix:

SET vPath = 'lib://FilePath/';

Directory;

LOAD

     *,

     filebasename( ) as x

FROM

[$(vPath)]

(biff, embedded labels, table is Sheet1$);

Where Lib is the connection name.

Thanks

1 Solution

Accepted Solutions
Highlighted
OmarBenSalem
Esteemed Contributor

Re: Upload all filename in a path

in this folder, you have many excel files for example, and you want to import the full name of each file?

Try as follow: (adapt it tu ur script)

Data :

load 0 as field AutoGenerate(0);

For Each vPath in FileList('lib://Test/*.xlsx')

Concatenate

Load

'$(vPath)' as name

FROM [$(vPath)]

(ooxml, embedded labels, table is Sheet1);

Next vPath

Drop Field field From Data;


Result:

Capture.PNG

1 Reply
Highlighted
OmarBenSalem
Esteemed Contributor

Re: Upload all filename in a path

in this folder, you have many excel files for example, and you want to import the full name of each file?

Try as follow: (adapt it tu ur script)

Data :

load 0 as field AutoGenerate(0);

For Each vPath in FileList('lib://Test/*.xlsx')

Concatenate

Load

'$(vPath)' as name

FROM [$(vPath)]

(ooxml, embedded labels, table is Sheet1);

Next vPath

Drop Field field From Data;


Result:

Capture.PNG

Community Browser