
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Selecting Multiple tables and left join with only one table
Hello,
I am sorry for this question.. I know this is a basic one. But couldn't implement, as I just started learning development.
I have a SQL select statement in QLikview
Ex:
Select
all the tables
from
table A
table B
table C
Table D
WHERE CONDITION
FILED 1.TABLE A = FILED1.TABLE B
FILED 2.TABLE B = FIELD2.TABLE B
and other linking conditions
GROUP BY FILEDS in all the tables
I need to use left join the table B with Table A.
i am not pretty sure to implement this as it has group by and where clause
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sowmiya,
The result of your demo query would be a single table which has already pre-joined the tables using standard SQL.
Doing that would look like:
Select
A1.DataKey,
A1.Data2,
B1.Data1
FROM
TABLEA A1
LEFT JOIN TABLEB B1
ON A1.DataKey = B1.DataKey
If you want to do the join in QlikView:
TableA:
LOAD
DataKey,
Data2
;
Select
DataKey,
Data2
FROM
TABLEA
;
LEFT JOIN (TableA)
LOAD
DataKey,
Data1
;
Select
DataKey,
Data1
FROM
TABLEB
;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sowmiya,
The result of your demo query would be a single table which has already pre-joined the tables using standard SQL.
Doing that would look like:
Select
A1.DataKey,
A1.Data2,
B1.Data1
FROM
TABLEA A1
LEFT JOIN TABLEB B1
ON A1.DataKey = B1.DataKey
If you want to do the join in QlikView:
TableA:
LOAD
DataKey,
Data2
;
Select
DataKey,
Data2
FROM
TABLEA
;
LEFT JOIN (TableA)
LOAD
DataKey,
Data1
;
Select
DataKey,
Data1
FROM
TABLEB
;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry If my question wasnt clear. I need to join within a table.. I believe now the mentioned where condition does eqi join.. I wanted to change that to inner join.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wanted to change that to a left join

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can you export to excel the content of each table (or a data sample) and show me how you would like the end result to look like.
Keep in mind, to change the type of joins, you can practically change the word 'LEFT' in the code I sent you with 'INNER/OUTER/RIGHT' if you need.
Check here some explanation about joins you can find useful: https://www.edureka.co/blog/sql-joins-types
Kind regards,
S.T.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I tried this and the qlikview is getting hung.. Actually, my first table called employee inner join with one of the table called sales.. so wen there is no sale data.. all my first emlloyee table fields as excluded.. so even wen there is no value in sale table , my employee table needed to show the values.
AS of in the previous script there is where clause instead of inner join.. I need to change that to a left join.
Also , followed by employee table there are many tables that get inner joined ..
.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can also check out the Design Blog area of Community:
https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog
There are over 700 posts there from our internal experts and most are how-to related, so should prove useful in trying to get ideas on how to approach things.
Regards,
Brett
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
