Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to make an overview of the files that I've loaded into my qvw.
When I use the Filename() expression, none of the filenames show up.
Im using multiple .txt files for data.
Is there a solution on how to show these filenames? And also create an overview of the loaded files?
Thanks in advance!
Okay guys,
Turns out that I used the filename() before a preceding load and not within the load statement itself.
So for those who are dealing with the same problem:
Define the Filename() in the load statement and if you are using preceding loads, then Load it in the Load statement and make sure you define it in the preceding load as well!
Can I assume you are using the FileName() in the LOAD? You should be doing this:
LOAD ...
FileName() as SourceFile
FROM ...
(txt, ...)
Then the SourceFile field will contain the full file path names.
Hello Jonathan,
I'm using the Filename() in the Load statement just as how you put it in the script.
Maybe because I'm loading in multiple files, the filename() wont work?
Hello Ivo,
Trust that you are doing good!
You can name the Tables same as file names (by enclosing them in square brackets - [ ], if required) and use $Table system field. This will list all of the QlikView logical tables present under the data model.
Hope this will be helpful.
Regards!
Rahul
>>I'm using the Filename() in the Load statement just as how you put it in the script.
>>Maybe because I'm loading in multiple files, the filename() wont work?
Multiple file names work fine - that is why the function exists.
I suggest you share the script code that is not working for more specific help.
May be like this,
Load
Subfield(Filename(),'.',1) as SourceFileName
from [*.txt];
The Script is as followed.
The other fields that are in the table are called FIELD for security reasons. Im sure that those fields are not interfering with the filename().
EventFact:
Load
FIELD
, FIELD
FROM
Rename Table EventFact to EventFact_Temp;
EventFact:
Load
FileName() as FileName
, FIELD
, FIELD
Resident
EventFact_Temp;
Hello Ivo,
If you have multiple tables in data model with different naming styles then you can make use of below script:
FileList:
LOAD DISTINCT
FileName() AS FileName
FROM
Table2:
LOAD DISTINCT
FileName() AS FileName
FROM
Table3:
LOAD DISTINCT
FileName() AS FileName
FROM
Please correct me if I misunderstood.
Regards!
Rahul
check in each and every table
FileName() as FileName1
FileName() as FileName2
FileName() as FileName3
like this for each and every load statement
and check for tables loading Ctrl +T will show Table viewer.
Try with Tables box-->add all the $ fields(System fields) and then you can watch entire things available in script
if you feel you got solution for your issue,please close the thread by clicking "Close Thread"