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

tFileExist - to read the file if exist is not working

Hi,

 

The job design is as below, which would be running in batch mode as .sh:

1. Read the connection parameters, assign to globalMap.

2. Read the application parameters, assign to globalMap.

3. Check if the restart file exist. If exist get the last processed ID and assign to globalMap.

4. On successful assigning last processed ID to globalMap, delete the file.

5. Read data from tables, process and update the table.

6. On unsuccessful exit on table update, create the file and save the last processed ID.

 

All the component works except tFileExist. It is not working as expected.

The file name is from globalMap variable - ((String)globalMap.get("filepath/filename"))

And this component is connected to tFileInputDelimited onSubjobOk.

 

The expectation is such that tFileInputDelimited should run only when file exist.

But actual scenario is that tFileInputDelimited run even when the file does not exist.

The tJava displays the filepath/filename as expected.

 

I have attached the screenshot.

Could you suggest how could I use the tFileExist with the file name from globalMap variable.

 

Thanks.

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

In the if condition put :
((Boolean)globalMap.get("tFileExist_1_EXISTS"))==true
If you want to continue if file exist
or
((Boolean)globalMap.get("tFileExist_1_EXISTS"))==false

View solution in original post

2 Replies
Anonymous
Not applicable
Author

I get "java.io.FileNotFoundException:" when the tFileInputDelimited_3 file does not exist.

This tFileInputDelimited_3 is invoked OnSubjobOk from tFileExist_1.

Anonymous
Not applicable
Author

In the if condition put :
((Boolean)globalMap.get("tFileExist_1_EXISTS"))==true
If you want to continue if file exist
or
((Boolean)globalMap.get("tFileExist_1_EXISTS"))==false