Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem with Filelist

I'm trying to extract some information from a filelist created with the 'for each Datei in filelist' statement.

The table TempFolder is created and the field 'QVDPathName' contains the complete path and the filename

with the extension.

If I try to extract the simple filename with the FileBaseName function, I'm getting only a blank field.

The 'QVDCreateTime' function works properly!

    for each Datei in filelist('$(vPath)' & 'QDatei*.QVD')

        TempFolder:

        Load

            '$(Datei)' as QVDPathName

        Autogenerate 1;

        Folder:

        Load

            FileBaseName(QVDPathName) as QVDName,

            QvdCreateTime(QVDPathName) as QVDDatum

        resident TempFolder;

     next

Any ideas, where the problem is?

Michael

6 Replies
rbecher
MVP
MVP

Hi Michael,

is FileName() working?

- Ralf

Astrato.io Head of R&D
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Use FileBaseName without parameters like: FileBaseName()

It returns the base name of the file currently being loaded.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi Ralf,

no FileName() is also not working. Maybe it is an issue of my installed version. Actually I'm using V10SR3.

I've initiated to update to the latest version.

Michael

Anonymous
Not applicable
Author

Hi Jonathan,

FileBaseName() without parameters is also not working. Maybe an issue of the version. See my earlier post.

Michael

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

OK, I see the problem. FileBaseName() only works in a load statement loading from a file (qvd, txt, xls etc) and does not work from a resident load or a database load. You are using it in a resident load and it will not work because it gets the base file name of the file being loaded.

Your best bet is to move the FileBaseName() to the TempFolder load. You can then fetch the basename from the temp folder in the second load

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Oh, and change the Autogenerate 1 to From [$(Datei)];

ie:

LOAD FileBaseName() As QVDName

FROM [$(Datei)];

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein