Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Data file Name into QVD

Hey,

Can I generate a QVD file that contains FileName of data files i am loading. And without using macro?

5 Replies
sunny_talwar

I usually do something like this in the load script.

Table:

LOAD yourFields,

          'SourceFileName' as [Source File Name]

FROM

SourceFile....

Store Table into ....

This would add the SourceFileName to all the data and can then be used to filter in your original application.

Not sure if this is what you wanted to do, but I hope it helps.

Best,

S

datanibbler
Champion
Champion

Hi @sunindia,

that is completely correct.

I would just like to add a common pitfall - that I, for my part, stumbled into a few times:

Just using, like "LOAD ... FROM;" without any further details won't work.

You have to specify what type of file you are loading. The easiest way to get these is to load something from that file (using the wizard, don't worry about details, just open the wizard and click on the file, make sure QlikView recognizes the file_type and then click  "Finish"), delete the "sheet is" part, that is not needed for the filename, and then build the LOAD like sunindia proposed.

Best regards,

DataNibbler

Not applicable
Author

I have hundred of files in folder and I don't wish to write file names

marcus_sommer

For this you could use file-functions like filename() - there are many more:

table:

Load *, filebasename() as Source From xyz;

- Marcus

Not applicable
Author

I used distinct without loading other fields and I got one row for each file