Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
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!

Tags (3)
1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: Loaded Files

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
Highlighted
MVP
MVP

Re: Loaded Files

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

Re: Loaded Files

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?

Highlighted
rahulpawarb
Valued Contributor III

Re: Loaded Files

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

Highlighted
neha_shirsath
Valued Contributor

Re: Loaded Files

Hi Ivo,

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

FileName() Function Limitations?

Thanks,

Neha

Highlighted
MVP
MVP

Re: Loaded Files

>>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
Highlighted
Partner
Partner

Re: Loaded Files

May be like this,

Load

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

from [*.txt];

Muthukumar Pandiyan
Highlighted
Not applicable

Re: Loaded Files

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;

Highlighted
rahulpawarb
Valued Contributor III

Re: Loaded Files

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

Highlighted
ramasaisaksoft
Valued Contributor III

Re: Loaded Files

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"