Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

join on like

hi,

Do you know how make a join on a like.

ID1= ID2 become ID1 like ID2

When I named both ID tthis the same name I have a join on equal only.

Thanks by advance.

Eva

1 Solution

Accepted Solutions
john_duffy
Partner - Creator III
Partner - Creator III

Hi Eva.

I tried a different approach:

Create a cartesian product with the two tables.

Use the length of ID1 to match to ID2 (ie.if (ID1 = left(ID2,length of ID1).

See the attched example.

John.

View solution in original post

5 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use this approach

     TableName:

     Load

          ID1..

     From..

     Left join(TableName)

     Load

          ID2 as ID1..

     From..

Hope it will help you

Celambarasan

Not applicable
Author

Hi, thanks for your answer but

I would like join if ID1 = 123 and ID2 = 123 45

I tried and that join if ID1= ID2 only.

tresesco
MVP
MVP

You can only use the join clause to join on the equality of one or many fields. If they're ALL equal, then it's a match, if not, then not. The only operators supported in the join clause are 'and' and 'equals'. If you only use inner join, then you could use a cross join instead to emulate an inner join and filter in the where condition, e.g:

Code Snippet

From a in db.Table1 _

From b in db.Table2 _

Where a.Something=b.Something And a.SomethingElse.StartsWith("a")

Regards,  tresesco

john_duffy
Partner - Creator III
Partner - Creator III

Hi Eva.

I tried a different approach:

Create a cartesian product with the two tables.

Use the length of ID1 to match to ID2 (ie.if (ID1 = left(ID2,length of ID1).

See the attched example.

John.

Not applicable
Author

Thnaks, that is a really good idea (specially for a friday) !! thanks for your help.

(I just hope it will work this my hudge table)