The help says that filename() should return the file name without the extension for table data sources. This SHOULD include QVD but it doesn't work as you say. It does work for excel table files.
For QVDs I found the following works in place: QvdTableName('file') . See below for an example
FileName() as Filename,
QvdTableName('[lib://Data/Customers.qvd]') as QVDFilename
Good to hear that I'm not the only one experiencing this issue. Unfortunately, your solution does not cover my use case.
I need to know the file name as I load with '*': "(FROM [lib://QvdLib/rtr_*.qvd] (qvd);". I'm loading several files with names like rtr_1.qvd, rtr_2.qvd and I need to capture the number.
There is a good example in "Syntax and Chart function guide", you can customize the following code:
// Example 2 - List all QV related files on disk
sub DoDir (Root)
For Each Ext in 'qvw', 'qvo', 'qvs', 'qvt', 'qvd', 'qvc', 'qvf'
For Each File in filelist (Root&'\*.' &Ext)
'$(File)' as Name, FileSize( '$(File)' ) as
Size, FileTime( '$(File)' ) as FileTime
For Each Dir in dirlist (Root&'\*' )
Call DoDir (Dir)
Call DoDir ('C:')
Logged a case with Qlik this is the response I received:
This is in reference to your case number - 01099753
Subject: Since 3.2.4 function filename() returns no data
A new comment has been posted related to your case :
Thank you for contacting Qlik Support.
If all the files are Excel files, then it is a know bug (bug id QLIK-76421). The bug is already solved internally and most probably will be available in the next service release.
It should work fine with for instance qvd or txt files.