Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

alwinsch
Contributor

Load script - file list

Hi all,

I want to load all filenames in temptable and use them for another script.

I have a very simple syntax

 

TEMP_FILE:

LOAD

FileBaseName() as "filename",

FileTime() as "Date_file"

FROM

;

There  should be 57 records in the table.

But it shows only 3.

What am i doing wrong?

Thanks,

A.

1 Solution

Accepted Solutions
flipside
Valued Contributor II

Re: Load script - file list

Okay, try this code instead if you just want the file names (this will return hidden files also) ...

For each file in FileList('C:\Users\alwinsc\Documents\QlikView\ProdStat\*')

    TEMP_FILE:

    LOAD

        subfield('$(file)','\',-1) as filename,

        FileTime('$(file)') as Date_file autogenerate 1;

Next;

Your filename will have the extension, but if you don't need it just wrap around another subfield statement with '.' delimiter.

flipside

5 Replies

Re: Load script - file list

Hi,

From my side script runs correctley please check once from your end.

Reagrds,

Anand

alwinsch
Contributor

Re: Load script - file list

No it does not work.

I get 2 filenames and i need some around 60.

flipside
Valued Contributor II

Re: Load script - file list

Are the files set to hidden? These won't show.

flipside

alwinsch
Contributor

Re: Load script - file list

No the folder and files are not hidden.

But when i create a new table i get some strange dimensions.

(please see attachment)

A.

Strange_icons.png

flipside
Valued Contributor II

Re: Load script - file list

Okay, try this code instead if you just want the file names (this will return hidden files also) ...

For each file in FileList('C:\Users\alwinsc\Documents\QlikView\ProdStat\*')

    TEMP_FILE:

    LOAD

        subfield('$(file)','\',-1) as filename,

        FileTime('$(file)') as Date_file autogenerate 1;

Next;

Your filename will have the extension, but if you don't need it just wrap around another subfield statement with '.' delimiter.

flipside

Community Browser