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

Global variable

Hi
I'm trying to download files from ftp from two folders: folder1 and folder2
And store that files into local machine in their respective folders. In local machine, name of folders are same like folder1 and folder2
Path of folders in local machine is C/Users/royDesktop/Talend At this location both both folders are there folder1 and folder2
So for common path I have developed context variable and trying to add after any global variable.
In child job, how can I call global variable with context variable in fields in tftpfilelist , tftpget components.
Like this context.remotedirectory + folder1(how to define global variable here for different varable and keep changing while job run.)
Is that possible to get values of these variable from parent job like I'm trying to do ?

Parent JoB
prntscr(dot)com/9ct9ea

Child Job
prntscr(dot)com/9cta50
Labels (2)
13 Replies
Anonymous
Not applicable
Author

A global variable works only in the current job. It's the reason why we put global variable value in a context.
However, the context variable must be declarated in your child job, isn't it ? Can you print me that please ?
Thanks,
Arnaud
Anonymous
Not applicable
Author

hey arnaudbroens
For child job I have declared the context variable there
Like you see 
http://prntscr.com/9cv287
http://prntscr.com/9cv25a
http://prntscr.com/9cv22n
Job is running, when I create separate subjobs in child job for every different folders seperately
For example
Child job
tftpconnection
|
tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectoryFolder1----filled in localdirectory) and (context.remotedirectoryFolder1----filled in remotedirectory)
|
tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectoryFolder2----filled in localdirectory) and (context.remotedirectoryFolder2----filled in remotedirectory)
But What I'm looking is
In child job I need like this
tftpconnection
|
tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectory+globalvariable(will iterate from parent job)----filled in localdirectory) and (context.remotedirectory+globalvariable(will iterate from parent job)----filled in remotedirectory)
SO that I don't need to create lot of sub jobs in child job for different different folders
Folder name value should come from parent job one by one and should be added to context variable I have defined dynamically.
0683p000009MACn.png
Anonymous
Not applicable
Author

Well, i think your job it's ok !
1. The parent generate 2 values (for local and remote http://prntscr.com/9cuosp).
2. The parent give 2 parameters to the child (global variable be transformed in context variable) http://prntscr.com/9cu9su
3. The parent call twice child
4. The child job use the context variable (in fact global variable from parent)
tftpconnection
|
tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectory+globalvariable(will iterate from parent job)----filled in localdirectory) and (context.remotedirectory+globalvariable(will iterate from parent job)----filled in remotedirectory)

5. Execution : 2 transits in the child job
tftpconnection
|
tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectoryFolder1----filled in localdirectory) and (context.remotedirectoryFolder1----filled in remotedirectory)
|
tftpfilelist(context.remotedirectory)----->tftpget(context.localdirectoryFolder2----filled in localdirectory) and (context.remotedirectoryFolder2----filled in remotedirectory)

It isn't the right way ?!
Arnaud
Anonymous
Not applicable
Author

I want to do multiple subjob of step 5 in one subjob by passing global variable
Please check your message box....