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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to pass sysdate in context file

Hi all,

 

I have a very simple requirement,I have a job which should take the Current date /Sysdate as a context and run the job.But i have an added requirement that I should be able to Override this value for any manual run or past run.I should be able to achieve this without opening the job.So the only way is the job should be able to take the sysdate from context file in Normal scenarios and should be able to take the date when manually overriden in the context file.

 

So can u please help me how can i pass talend.getcurrentdate function in the context file or just giving sysdate will help this regard.We tried giving the currentdate function in the context group,but it s taking as a string and not parsing the date in the next step.

 

regards,

sowmya.N

Labels (1)
3 Replies
Anonymous
Not applicable
Author

You can do this with a bit of code in a tJava at the beginning of your job. This should work....

if(context.dateNow==null){
	context.dateNow = routines.TalendDate.getCurrentDate();
}

 

Anonymous
Not applicable
Author

yaa as of now i am doing like this only..wanted to check if any other option is there.

Anonymous
Not applicable
Author

I don't understand why you want to do it differently? This solves your problem and is a perfectly acceptable way of doing this. Can you tell me what is wrong with this and maybe I can make another suggestion which might be more suitable?