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: 
_AnonymousUser
Specialist III
Specialist III

use of globalContext and variable file name in lookups and main flow

We have a job wherein we have to lookup multiple files but the file names are not constant. So I have to iterate thru the main file and get variable part of the file name and use that for lookup files. However when running the job, the lookup files fail coz they seem to processing before I iterate the main file to get the variable extn!

Labels (2)
1 Reply
Anonymous
Not applicable

Hi
Can you please show us the more details of your job? I think there must be a job design issue. The job looks like:
tfileinput1--main(row1)--tFlowToIterate--iterate--tJava--oncomponentok--tfileinput1--main--tMap--out1--
                                                                                                                              |
                                                                                                                           lookup
                                                                                                                              |
                                                                                                                        tfileinput2
tfileinput1: read the lookup file name from a file and then iterate each one
tJava: store the current lookup file name to a context variable, let's call it context.filename, eg
context.filename= (String)globalMap.get("row1.colName")

tfileinput2: set the file path with context variable, for example:
"d:/file/"+context.filename

Regards
Shong