Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
daniellesacks
Contributor
Contributor

Parameterizing job based on token drops from different databases

I currently have two separate jobs that load data into the same destination database, but they come from two different sources - Source1 and Source2. Source1 and Source2 each have their own token drop. Both of these jobs have the same queries and grab from identically built tables. 

 

I need to combine these two jobs into a single job that, based on the individual token drops, will pass the correct parameters into the job and pull from the correct source. So, if the token for Source2 drops, the job will need to run with Source2 connection information.

 

How would I set up and pass these parameters through the job?

 

TYIA!

Labels (2)
2 Replies
Anonymous
Not applicable

Hi
Using context variables to configure the DB parameter, assign corresponding value to context variable based on the individual token drops, I don't know how the token drops comes in your job, just give an simple example to explain the logic process:
tJava
|onsubjobok
tDBInput...>tDBoutput

on tJava:
...balabalabala..get your token drops and analyse its value...
if(token.equals("Source1"){
context.host="host1";
context.database="database1";
..other context variables....
}else{
context.host="host2";
context.database="database2";
..other context variables....
}

Regards
Shong

daniellesacks
Contributor
Contributor
Author

Thanks, I will give this a go and get back to you.


@shong wrote:

Hi
Using context variables to configure the DB parameter, assign corresponding value to context variable based on the individual token drops, I don't know how the token drops comes in your job, just give an simple example to explain the logic process:
tJava
|onsubjobok
tDBInput...>tDBoutput

on tJava:
...balabalabala..get your token drops and analyse its value...
if(token.equals("Source1"){
context.host="host1";
context.database="database1";
..other context variables....
}else{
context.host="host2";
context.database="database2";
..other context variables....
}

Regards
Shong