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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Join by SQL Statement

Hi,
I want to join 2 tables and filter the data according to some rules.
I already have the sql statement for this operation from my colleague.
So, is there anyway I can directly use this sql statement to join and filter the data from these 2 tables?
or do I have to use tMap to put in the conditions?
Please reply ASAP..
Thank You.
Kyaw Lwin Phyo
Labels (2)
12 Replies
Anonymous
Not applicable
Author

Hi
You can use txxxRow such as tMysqlRow the execute the sql statement if the sql statement have already achieved the request join two table and filter data. Or use a tMap to do the join and add filter condition to filter the data.
Best regards
Shong
Anonymous
Not applicable
Author

Hi Shong,
Thanks for the fast response...
What kinda txxxRow should I use?
My input is from oracle and output is to MySQL.
Thanks again...
Kyaw Lwin Phyo
Anonymous
Not applicable
Author

Hi
Please use tMap component and create the general job if the input and output tables are in different database type.
Best regards
Shong
alevy
Specialist
Specialist

You can put any select statement you want in your input component (join, group by, where, order by, nested) as long as the schema you define is consistent with the result of the query.
Anonymous
Not applicable
Author

Hello...
I have put a query in tMySqlInput component and direct this component to tMap.
but in tMap, the result from my query is not there but the standard columns from the table.
My table has Year, Week, Month, Start Date, End Date columns
and my query returns the concated value of YearWeek-Start DateEnd Date as period.
However, in tMap, I'm only seeing the columns but not my returned value.
I've tried with tMySqlRow too.
I need this period variable to validate the data from another table which I need to join.
Any Suggestion????
Thank you.
Kyaw Lwin Phyo
Anonymous
Not applicable
Author

Hi
Please upload some screenshots of job or show us an example to explain your request, so that we could help you further.
Best regards
Shong
alevy
Specialist
Specialist

Put up a screenshot of your job and the tMySqlInput settings, particularly the query and schema
janhess
Creator II
Creator II

Did you do a guess schema for your query?
Anonymous
Not applicable
Author

I have uploaded the screenshots
First one is how I'm trying to do.
I have one table that has data and another weeks table which has the dates
I have to filter the data from first table with the dates from weeks table.
Second one is my query.
In fact the full query is like
getting the period value below to check the local_date of the table.
"SELECT concat(w.year, w.week, date_format(w.`Start Date`, '%d-%b-%Y'), date_format(w.`End Date`, '%d-%b-%Y')) period
FROM calendar.weeks w
WHERE date_sub(curdate(), interval 7 day) >= w.`Start Date`
AND date_sub(curdate(), interval 7 day) <= w.`End Date`; => period = 20113604-Sep-201110-Sep-2011"
Third one is how I'm getting in tMap.
Thank You.....
(if images are not available please also tell me how to upload images..
I've tried from the link https://community.talend.com/t5/Design-and-Development/how-to-upload-an-image/td-p/60550)