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

How to change context variables permanently after job execution

Hi,

 

There is a field called "value" which has to be incremented for every execution of job. I wanted to increment it and set to context variable permanently, so that the new value is used in next job execution.

 

Is this possible? If yes, Can anyone guide me doing this?

 

Thanks,

Meghana.

Labels (2)
7 Replies
fdenis
Master
Master

its possible.
Add a to job who read this file, run your job using tRunJob (adding value into context) and write e new file.

but the best way is to store this value into a db using sequence.
Regards,

TRF
Champion II
Champion II

Search for "implicit context" or "tContextLoad" to discover how to get context variables from an external file.
From there it's quite easy to do what you want.
fdenis
Master
Master

did you solve your problem?
Anonymous
Not applicable
Author

hi Meghana,

since the requirement would not allow any variable creation within the job for such scenario , thus its better you go for counter value fetch from any database's table or from any file at the start of job and at the end of the job update that table or file with increment in its last value.

 

 

Regards

Chandra Kant

Anonymous
Not applicable
Author

Is it the only possible way..?

 

Can't we store somewhere in our job..?

 

Thanks!

Anonymous
Not applicable
Author

storing somewhere within the job means that variable needs to be created and initialized within the job and this will execute every time you run the job thus making it difficult to work as counter for job execution.

It would be better to use variable value from outside the job be it using file or table or tcontextload.

the flow could be read the value--> task --> update the value.

 

 

 

Regards 

Chandra Kant

Anonymous
Not applicable
Author

Thank you