Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
chichibio
Contributor III
Contributor III

How to set context variables with query result

Hi at all 0683p000009MACn.png,

I've necessary execute 2 query. The first query results is a parameter that I would use in second query.
For example:
1 Query: select max(date) from A
2 query: select count(*) from B where max(date.A) > max(date.B)
I would use max(date.A) like variable, so : Select count(*) from B where "variable" > max(date.B)
How I can do it?
Best regards
thnx at all

Labels (2)
3 Replies
Anonymous
Not applicable

It depends on how you want to use the value, timing, flow vs iterate connections, etc, etc. But as a start I would recommend returning your result from a db input component and then using a tJavaRow component to set the result to a context variable. 

You might also want to look at the tContextLoad component as that might solve your problem in an easier way.
chichibio
Contributor III
Contributor III
Author

rhall_2.0 wrote:
It depends on how you want to use the value, timing, flow vs iterate connections, etc, etc. But as a start I would recommend returning your result from a db input component and then using a tJavaRow component to set the result to a context variable. 

You might also want to look at the tContextLoad component as that might solve your problem in an easier way.

It's a simple flow. Nothing else... 
Just read from table > put the result in variable and compare with another date from another db and table..finally count the difference of record.
0683p000009MH5d.png
chichibio
Contributor III
Contributor III
Author

help me !!! 0683p000009MPcz.png 0683p000009MPcz.png 0683p000009MPcz.png 0683p000009MPcz.png please

how I can do it!!thnx