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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
satyavar
Contributor III
Contributor III

[resolved] How to use context variables in Query?

Hi
Can some one please let me know if it is possible to update the context variables? If yes, how?
and is it possible to use the context variables in Query area of a Input table object? (Not using tFilterRow)
Best Regards,
Kalyan
Labels (2)
12 Replies
satyavar
Contributor III
Contributor III
Author

Thanks Vaibhav, I have started working with your suggestion. But i would need to surpass one last hurdle to complete this job.
As you suggested, I have taken the approach of PreJob -> Which reads the datetime from a sql table and updates a context variable of Date type.
Then, i am using the context variable value to use it in where clause of a oracle table.
But i am getting some exceptions like below: Exception in component tMSSqlInput_1
java.sql.SQLException: Unable to convert between net.sourceforge.jtds.jdbc.DateTime and INTEGER.
Anonymous
Not applicable

Datetime context variable set it to Date...
before using the query in component, use tjava and use print statement and check the correctness of the query using query browser... else make appropriate changes in the datatype or casting operations...
vaibhav
satyavar
Contributor III
Contributor III
Author

Works like a charm, Thanks.