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

[resolved] tFileExist for multiple files

Hi,
Is it possible to use only one tFileExist for many files?
For example i want to check 3 files. I must use 3 tFilexist.
Thank's Smiley Happy
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

tFileList --Iterate-->tFileExists (use as file name here ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) )
There is no reason because of something fails here. The existence of a file can be checked with the return value EXISTS (check the Outline view) of the tFileExists component. You could extend this the if trigger staring from the tFileExist component and ends up on a component or subjob which is dedicated to the fact of the existence or even not.

View solution in original post

8 Replies
Anonymous
Not applicable
Author

No this component works only for one file. If you have to check the existence of multiple files I suggest you use tFileList and set as filter expression your file names and check the returned number of files. 
Anonymous
Not applicable
Author

OK, thank's i will try this
Best regards,
G47
Anonymous
Not applicable
Author

 Thank you Mr.Jlolling. can any one please give me one example to  check existence  of  multiple files with tFileList and tFileExist components, I worked with this But tfilelist is not throwing an error if some files are not available in  the source. how can we keep filter expression. your  advices are appreciated.
Anonymous
Not applicable
Author

tFileList --Iterate-->tFileExists (use as file name here ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) )
There is no reason because of something fails here. The existence of a file can be checked with the return value EXISTS (check the Outline view) of the tFileExists component. You could extend this the if trigger staring from the tFileExist component and ends up on a component or subjob which is dedicated to the fact of the existence or even not.
Anonymous
Not applicable
Author

Thank you jlolling. 
i did tFilelist-->tFileExists-->runif(tfileexist.exist)tmsgBox("filefound"), like wise another  -->runif-- tMsgBox("file not fornd ") on (!tFileexist.exist)
but above job showing only file names which  are matching from tFileList->filemasklist names to the folder where we are checking the existence. but  how can we throw the error on file which is in fFilelist filemask but not in the source folder.
ex: I have a FOLDERS called AGENCY it has 13 text files from that files i should take only 7 required files, so i need to check wether the folder has that 7 required file or not. so i am entering those 7 names in tFileList. here if any  required file(among those 7) is not availble in Agency folder then i have to throw the error "so and so file(or)files are missing ".
becoze some times agency folders may not have the required file. i should know which file is missing.
can you please suggest me.
Anonymous
Not applicable
Author

If you need 7 particular files I suggest you use simply 7 dedicated tFileExists.
You could use a tFileList to iterate over the directories (list directories instead of files) and use the mentioned CURRENT_FILEPATH (which contains now the path to the directory).
I suggest use create a separate job which gets the directory via a context variable and check and process in this job the necessary files with dedicated tFileExists (e.g. 7 of them). 
Anonymous
Not applicable
Author

can you please share snippet or screeenshot of job?
smathew2949
Contributor III
Contributor III

How i did is tFileList-->tFileExist but inside tFileList I added filter for all the files I am looking for below is the screenshot of what i did to achieve this. Hope this will help

 

0695b00000PMHinAAH.png 

0695b00000PMHjCAAX.png