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: 
Not applicable

Loaded Files

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!

1 Solution

Accepted Solutions
Not applicable
Author

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!

View solution in original post

14 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

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.

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

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?

rahulpawarb
Specialist III
Specialist III

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

neha_shirsath
Specialist
Specialist

Hi Ivo,

Read the below post,It might be helpful to you.

FileName() Function Limitations?

Thanks,

Neha

jonathandienst
Partner - Champion III
Partner - Champion III

>>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.

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

May be like this,

Load

Subfield(Filename(),'.',1) as SourceFileName

from [*.txt];

Muthukumar Pandiyan
Not applicable
Author

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;

rahulpawarb
Specialist III
Specialist III

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

ramasaisaksoft

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"