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

Issue with passing variable with context

Hi,
I am trying to set a date stamp - 20091208 to use in may jobs to call my daily files.
I have set a context with the value equal to:
TalendDate.formatDate("yyyy",TalendDate.getCurrentDate()) + TalendDate.formatDate("MM",TalendDate.getCurrentDate())+TalendDate.formatDate("dd",TalendDate.getCurrentDate())
I call my variable using the context call: today_YYYYMMDD
Unfortunately when I run my job, the variable is returing the actual value (formula) TalendDate.formatDate("yyyy",TalendDate.getCurrentDate()) + TalendDate.formatDate("MM",TalendDate.getCurrentDate())+TalendDate.formatDate("dd",TalendDate.getCurrentDate())
and not the anticipated 20091208
Your help is appreciated
Regards
Yann
Labels (2)
2 Replies
Anonymous
Not applicable
Author

Context variable are Strings. So they are not interpreted as java expression and are not evaluated.
_AnonymousUser
Specialist III
Specialist III

We ran into the same issue. Use an input sql, inputFile, or tFixedFlowInput to write to a tContextLoad component which then triggers the first subjob. This will enable the java expression to be interpreted and populate your context variable each time it runs.