Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
nihhalmca
Specialist II
Specialist II

When Use Keep When Use Join

Hi All,

I have knowledge what is KEEP and JOIN. I am trying to know which scenario will

use KEEP (ex: LEFT KEEP) and which scenario will use JOIN (ex: LEFT JOIN).

Can you people share with examples.

Regards,

Nihhal.

26 Replies
nihhalmca
Specialist II
Specialist II
Author

Hi Jagan,

I tried your examples result as

LEFT KEEP

Transaction:

Country ID,  Sales

1, 1000

2, 3000

Countrymaster:

Country ID,  Country

1, USA

2, INDIA

3, UK    

LEFT JOIN

Country ID,  Sales, Country

1, 1000, USA

2, 3000, INDIA

I did not understand difference between LEFT KEEP and LEFT JOIN? (Just difference no of tables)

Can you give brief example if possible.

Thanks,

Nihhal.

its_anandrjs

Hi Nikhil,

When you use the left Join functionality as Jagan give example by expression

Transaction:
LOAD * INLINE [
CountryID, Sales
1, 1000
2, 3000  ]
;

CountryMaster:
LEFT JOIN (Transaction)
LOAD * INLINE [
CountryID, Country
1, USA
2, India
3, UK ]
;


You get result single table with data

Left Join2.png

And if you use Left Keep

Transaction:
LOAD * INLINE [
CountryID, Sales
1, 1000
2, 3000  ]
;

CountryMaster:
LEFT KEEP (Transaction)
LOAD * INLINE [
CountryID, Country
1, USA
2, India
3, UK ]
;

You get two tables and join performs but data of same records in the second table that is CountryMaster

Leeft Keep.png

Hope this helps

Regards

Anand

nihhalmca
Specialist II
Specialist II
Author

Hi Anand thanks for writing.

As per above conversations, only difference is number of tables?

I have read 'KEEP' as one of the performance technique.

Regards,

Nihhal.

Not applicable

HI,

In simple words

-->>Left keep is same like left join ,it does the join but it keeps the table separate in data model.

-->>Left join, joins the two tables and make it one table.

thats the only diffrence.and this technique is helpful as per scenarios that anybody can get.

thanks

Sudhanshu shrivas

nihhalmca
Specialist II
Specialist II
Author

Hi Shrivas,

Thanks for reply.

Can you share which scenario we go for JOIN and which scenario we go for KEEP if possible.

Regards,

Nihhal.

jagan
Luminary Alumni
Luminary Alumni

HI Nihhal,

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.

Regards,

Jagan.

Anonymous
Not applicable

Hi,

left keep and left join gives the same output.the only difference is :

Left Keep : keeps the table separate in data model.

Left Join : merges the tables that are joined

Regards

Neetha

nihhalmca
Specialist II
Specialist II
Author

Hi Jagan,

Thanks for response. It seems to help me if you share small example.

Regards,

Nihhal.

vardhancse
Specialist III
Specialist III

Hi,

You can close the thread if you got required information.

Regards,

Sasi

nihhalmca
Specialist II
Specialist II
Author

Please see my last reply on this post. So i am waiting for response from jagan.