Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Getting the file name from tfilelist

Hello All

 

I do have a requirement, i wanted to read the file names from tFile list which i did in below method, and able to read the file names

 

0683p000009M885.png

 

But i need to read the files names and data corresponding to the files , to let me know from which file data came, but when i run the job below, with design  

 

0683p000009M88A.png

 

There are 3 files in the files list , am able to see data one after another, but am unable to see from which file the data is came from, what design or method would be better to see that way

 

right am seeing the  data like below format

 

id, name

1,Manish

------------

id, name

2,Manish

------------

id, name

3,Manish

 

but i wanted to see in this below format to know from which file it is coming from

File1

id, name

1,Manish

------------

File2

id, name

2,Manish

------------

File3

id, name

3,Manish

 

 

Thanks In Advance 

Manish

 

 

Labels (3)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

So you want to retrieve the filename in your output, that's it? But you don't do anything for that. Add filename as a new field for your tMap output and use the following expression to populate that field:
(String)globalMap.get(tFileList_1_CURRENT_FILE)

View solution in original post

5 Replies
TRF
Champion II
Champion II

Share your tMap
Anonymous
Not applicable
Author

@TRF  Thanks  please find below

 

 

0683p000009M88F.png 

 

 

TRF
Champion II
Champion II

So you want to retrieve the filename in your output, that's it? But you don't do anything for that. Add filename as a new field for your tMap output and use the following expression to populate that field:
(String)globalMap.get(tFileList_1_CURRENT_FILE)
Anonymous
Not applicable
Author

@TRF Thanks it worked out. but if am using with multiple files, every name is popping with same file name , that is the limitation now

TRF
Champion II
Champion II

I'm sure of not.
You'll have the same filename for every record from the same file and different filenames as soon as the input file will change.