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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What is the Diffrence between keep and Join?

Hi,

1) What is the Diffrence between keep and Join?

2) By default What type of join qlikview Consider ?

2 Replies
wizardo
Creator III
Creator III

Hi,

1) when you make a join you get one table out of two

if you make a left or right join then one table will have all its records in the new table and the other table will only have its matching keyvalues records in the new table but you will again end up with one table

when you replace the join wiht a keeo then qlikview will keep both tables (linked via the same name fields) but will remove from one of the tables (left or right) the records with NON matching keyvalues. hence KEEP is only meaning full with addition of the LEFT or RIGHT before it.

2) by default qlikview dont do joines, if you want to join two tables you must type the keyword JOIN (or left/right JOIN) between the loads of the two tables

qlikviw will use all fields with matching NAMES as the join fields. at the end of script you will remain with only one table. like i said above, if you use keep instead of join (or if you dont use any of them), at the end of script you will have two seperate tables LINKED via the matching field names.

further info can be found on page 469 of the reference manual

WIzardo

Not applicable
Author

The below example give you clear picture of difference between Keep and join

Example

Table1

A

B

1

aa

2

cc

3

ee



Table2

A

C

1

xx

4

yy



QVTable:

select * from table1;

left join select * from table2;

QVTable

A

B

C

1

aa

xx

2

cc

3

ee



QVTab1:

select * from Table1;

QVTab2:

left keep select * from Table2;

QVTab1

A

B

1

aa

2

cc

3

ee



QVTab2

A

C

1

xx