Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

join and keep

Hello everyone,

i come to know when we have to used keep or join in qlikview script.

i used both keep and join but i didnt found any difference(both are same)

EXCEPT

join gives result in a single table and keep gives result in two separate tables.


please let me know any difference is there.


Thank you


Best,

Prachi

1 Solution

Accepted Solutions
rahulpawarb
Specialist III
Specialist III

Hello Prachi,

Below are few points:

1. In Join, you can perform OUTER JOIN (returns matching as well as non-matching data from both the tables); whereas KEEP don't have that option.

//Syntax of Keep

(inner | left | right) keep [(tablename ) ]( loadstatement | selectstatement )

//Syntax of Join

[inner | outer | left | right ]Join [ (tablename ) ]( loadstatement | selectstatement )

2. Post joining/relating two tables you don't want 2nd table in the Data Model then go ahead with JOIN else use KEEP (OUTER JOIN is exception).

3. INNER/LEFT/RIGHT KEEP exactly like an INNER/LEFT/RIGHT JOIN respectively except the two tables are not combined in the data model.

Hope this will be helpful.

Regards!

Rahul

View solution in original post

9 Replies
sarvesh
Creator III
Creator III

Hi..Prachi,

Please refer attached file for more clarification.

Regard's

Sarvesh Srivastava

Not applicable
Author

This two function works internally differently. Please go through QlikView 11 for  Developers page 227-230

sarvesh
Creator III
Creator III

If your problem has been resolved then mark "Correct and Helpful" to close this thread.

Regard's

Sarvesh Srivastava

Anonymous
Not applicable
Author

how i know when i have to used keep or join..

neha_shirsath
Specialist
Specialist

Hi Prachi,

It's depend on what scenario you have,

If you have one to many or many to many relationship then we can use KEEP, because if we use join the records will be duplicated.


Thanks,

Neha

sarvesh
Creator III
Creator III

1. Join – Join will merge tables into single table.

2. Keep – if we use keep word instead of join then it will make both tables as separate at the database



Regard's

Sarvesh Srivastava

rahulpawarb
Specialist III
Specialist III

Hello Prachi,

Below are few points:

1. In Join, you can perform OUTER JOIN (returns matching as well as non-matching data from both the tables); whereas KEEP don't have that option.

//Syntax of Keep

(inner | left | right) keep [(tablename ) ]( loadstatement | selectstatement )

//Syntax of Join

[inner | outer | left | right ]Join [ (tablename ) ]( loadstatement | selectstatement )

2. Post joining/relating two tables you don't want 2nd table in the Data Model then go ahead with JOIN else use KEEP (OUTER JOIN is exception).

3. INNER/LEFT/RIGHT KEEP exactly like an INNER/LEFT/RIGHT JOIN respectively except the two tables are not combined in the data model.

Hope this will be helpful.

Regards!

Rahul

Anonymous
Not applicable
Author

thanks rahul..

rahulpawarb
Specialist III
Specialist III

welcome

-Rahul