
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Join two tables on multiple columns
Hi All,
Can any one explain how to join two tables on multiple join conditions.
I have two table with 3 common fields. I need these fields in report. i don't want to concatenate these fields. If concatenate how get back these fields.
Thanks.
- « Previous Replies
-
- 1
- 2
- Next Replies »

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you want to keep them as separate tables and let QlikView handle the join implicitly? If yes, then check this: Concatenate vs Link Table
Else for join, you can keep the field names as is and join them: Understanding Join, Keep and Concatenate

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try to load two tables with Noconcatenate statement.
Then you should get a synthetic key containing 3 common fields.
Best practice is to avoid synthetic key by using Autonumber statement that contains 3 common fields. Just load those 3 fields in one table not in both.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Give the fields on which the tables should be joined the same name.
talk is cheap, supply exceeds demand


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hari,
Which join you want to use? I guess it should be INNER JOIN. I would suggest create the Composite Key by Using Autonumber function for both the tables and then join the two tables on this new Key and then Drop the 3 fields from Either of the table as appropriate.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reply

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Use like this,
Table1:
Load
City,
State,
Country,
City & State & Country as Key,
Column1
from Table1;
Table2
Load
City & State & Country as Key,
Column2
from Table2;
I hope its helpful for you.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is not a join plus you are doing exactly what the OP asked not to want: Concatenating those fields. What you are doing is just loading two tables.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To join two tables on multiple fields, just use JOIN. Yes, it is that easy. Qlik will recognize the fields with the same name and join the tables on those fields.
You can add LEFT, RIGHT, INNER or OUTER to the join to achieve the type of join you want.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Hari,
My best idea is u need to create a Key field like
First_name &' '&Middle_Name&' '& Last_name as Full_name
need to create in both tables.
so that 2 tables will join on one KEY (Full_name ) itself without Synthetic Keys.

- « Previous Replies
-
- 1
- 2
- Next Replies »