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

Modify context variable permanently

Hi,

 

Is it possible to modify a context variable within a job, so I can use the newest value of the context variable the next time I run the job?

 

I would like to use this feature to store the last time the job has run btw.

 

Thanks.

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Use tContextDump to overwrite the context file with the current values for all the context variables.

View solution in original post

7 Replies
TRF
Champion II
Champion II

Use tContextDump to overwrite the context file with the current values for all the context variables.

Anonymous
Not applicable
Author

A context file? I'am new to Talend so I don't really know what a context file is, I'am just using the view under my job for setting the context variables and I preferer to keep it this way so I don't have to create other seperate files on my computer.
TRF
Champion II
Champion II

This view is usefull only when running jobs from the Studio.

As soon as you'll run the jobs from the command line or a scheduler, you'll have to manage 1 or more context files which can be overwritten at runtime bt the jobs.

During the development cycle, it's a good practice to use a context file to avoid any surprrise after job deployment.

Have a look to the documentation or search for "implicit context" or something like that.

Anonymous
Not applicable
Author

I tried to override the context variable with a tJava but when i use a tContextDump it stills printing the old value in the file. How I can overcome this?
TRF
Champion II
Champion II

Share your job design and tJava piece of code

Anonymous
Not applicable
Author

I have tried tcontextDump with tjavaRow and tContextLoad.
The log is succesfull but after running the job the context variable does not get updated...

The idea is to store in the context variable the last time the job run in order to load only the delta
Anonymous
Not applicable
Author

0683p000009M1Tr.png

The code of tJavaRow is the following:

output_row.key = input_row.key;
output_row.value = input_row.value;
if(output_row.key.contains("date"))
{
output_row.value = "Hello";
}