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

Join with Contains

Hi,

I have Table A that with multiple fields among them Page_Name.

and an excel that is as below let's call it Table B:

Asset_New              Page_Name

Coca Cola               -CO

Orange                     -ONG

Soda                          -DA

 

i want to make a join where if Page_Name from Table A contains the letters from Page_Name from Table B, then return Asset_New.

how can i please do it?

thank you!

1 Solution

Accepted Solutions
Taoufiq_Zarra

@Shir63  like ?

TableA:
load * inline [
Landing_Page                
I Drink -Coca Cola
I love this-ONG
];

left join

load Landing_Page as Flag,"New Name" inline [
Landing_Page,New Name
-Co,Coca Cola
-ONG,Orange
];

output:
noconcatenate

load Landing_Page,"New Name" resident TableA where wildmatch(Landing_Page,'*'&Flag&'*')>0 ;

drop table TableA;

 

output:

Taoufiq_Zarra_0-1643725063400.png

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

6 Replies
Taoufiq_Zarra

@Shir63  Lookup function if I understood correctly

https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/InterRe...

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Shir63
Contributor III
Contributor III
Author

hi,

thank you for your reply.

when using the Lookup how are you suggesting to use the "Contains"? the values are not the same, so that in Table A there is a full sentence for example: "I drink alot of -coca cola today"

and table B has only "-Co"?

 

 

Taoufiq_Zarra

@Shir63  can you share a sample data and the expected output ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Shir63
Contributor III
Contributor III
Author

Table A:

Landing_Page                

I Drink -Coca Cola

I love this-ONG

 

Table B:

Landing_Page           New Name

-Co                                 Coca Cola

-ONG                              Orange

 

i need to lookup value in Table A that contains the letters from table B.

so the outcome is just table A

with 

Landing_Page                  New Name   

I Drink -Coca Cola           Coca Cola

I love this-ONG                 Orange

Taoufiq_Zarra

@Shir63  like ?

TableA:
load * inline [
Landing_Page                
I Drink -Coca Cola
I love this-ONG
];

left join

load Landing_Page as Flag,"New Name" inline [
Landing_Page,New Name
-Co,Coca Cola
-ONG,Orange
];

output:
noconcatenate

load Landing_Page,"New Name" resident TableA where wildmatch(Landing_Page,'*'&Flag&'*')>0 ;

drop table TableA;

 

output:

Taoufiq_Zarra_0-1643725063400.png

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Shir63
Contributor III
Contributor III
Author

thank you, you are the king!!!