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: 
krishu
Contributor II
Contributor II

Transformation Stroing 2 SQL query result set and using that in different SQL query

Hi Team

I have 2 different SQL queries in which the 1st query result (HireDate) will be used in 2nd query to get the MaximumDate and the results from the 1st and 2nd query will be used in the 3rd SQL query to filter the data.

Example:

1st Query: HIRE_DATE = (SELECT NVL(RECENT_HIRE_DATE, SYSDATE - 1) FROM EMPLOYEES WHERE DEP_ID = 'D000001';

2nd Query: MAXIMUM_DATE = SELECT TRUNC(HIRE_DATE + 1) FROM DUAL.

3rd Query: SELECT * FROM EMPLOYEES

WHERE HDATE >= HIRE_DATE AND HDATE < MAXIMUM_DATE;

So my question is how to pass the Query1 result into Query2 and finally Query1 & Query2 results into Query3? Please could anyone help me on designing the job!

Thanks & Regards

Krishu

1 Reply
manodwhb
Champion II
Champion II

@sai kris​ , this is one-way you need to load the results into context and you need to use those. Check the below link to set context.

 

otherway you can try to use tflowtoiterate component to do the way aslo.

 

https://help.talend.com/reader/U5lNkhUnaW6RdpL8qxP61w/d0QVvShdlGcIqowdsla3lw

 

 

Thanks,

Manohar