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

Join and Keep

What difference between keep and join

Thank you

8 Replies
engishfaque
Specialist III
Specialist III

Dear Krishnakanth,

Please check,

Understanding Join, Keep and Concatenate

Kind regards,

Ishfaque Ahmed

Anonymous
Not applicable
Author

Hi

T1:

LOAD * INLINE [

    A, B

    1, 1

    1, 1

];

join(T1)

T2:

LOAD * INLINE [

    C, D

    1,1

    1,1

];

If you join the above two tables ,the result will be in one table .All the rows in will be added to T1.

A B C D
1111

Keep:

This will function same as the join but keeps two tables separate.

left keep    

B ID
101
203

D ID
1
3

Go through below link

Understanding Join, Keep and Concatenate

Anonymous
Not applicable
Author

Hey,

Both join and keep performs the same task.

The only difference is that join keyword will combine your tables into a single table but keep will keep it as separate tables.

Thanks,

gautik92
Specialist III
Specialist III

Hi Krishnakanth,

Join merges two tables and there will be only table after merging

Keep matches two tables and keeps two tables

krishna20
Specialist II
Specialist II

HI,

FYI from Help..

Keep

The keep prefix is similar to the Join prefix. Just as the join prefix, it compares the loaded table with an existing named table or the last previously created data table.

But instead of joining the loaded table with an existing table, it has the effect of reducing one or both of the two tables before they are stored in QlikView, based on the intersection of table data. The comparison made is equivalent to a natural join made over all the common fields, i.e. the same way as in a corresponding join. However, the two tables are not joined and will be kept in QlikView as two separately named tables.

The keep prefix must be preceded by one of the prefixes Inner, Left or Right. The syntax is:

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

Example:

Inner Keep LOAD * FROM abc.csv;

Left Keep SQL SELECT * FROM table1;

tab1:

LOAD * FROM file1.csv;

tab2:

LOAD * FROM file2.csv;

.. .. ..

Left keep (tab1) LOAD * FROM file3.csv;

Join

The join prefix joins the loaded table with an existing named table or the last previously created data table. The join is a Natural Join made over all the common Fields. The join prefix may be preceded by one of the prefixes Inner, Outer, Left or Right. When DISTINCT predicate is used in a LOAD statement, the resulting table becomes distinct. Any data added to the table also becomes distinct, regardless if the data is concatenated or joined.

The syntax is:

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

Examples:

Join LOAD * FROM abc.csv;

Join SQL SELECT * FROM table1;

tab1:

LOAD * FROM file1.csv;

tab2:

LOAD * FROM file2.csv;

.. .. ..

join (tab1) LOAD * FROM file3.csv;

Regards

Krishna

qlikviewwizard
Master II
Master II

Hi,

Please check this link. It has clearly explained. Thank you.

Re: Understanding Join, Keep and Concatenate

maxgro
MVP
MVP

thanks to Enmanuel Santana (qlikview en espanol)


join.png





keep.jpg

Anonymous
Not applicable
Author

Hi Krishnakanth,

See below post:

Re: Left Keep Vs Left Join