Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
firstnameunknown
Contributor II
Contributor II

How to join two tables if the primary keys have two values

Table A: Primary key is contact id but some cells have two contact id in it.

Table B: Contact id is the primay key. Contact name.

I want to left join Table B into Table A, so the contact names would show in the same column with comma seperared according to the contact id in the Table A.

How can I do it?

Capture.PNG

Labels (1)
16 Replies
chaorenzhu
Creator II
Creator II

aggr(concat([Contact Email],','),id)

anat
Master
Master

Client Product

1 A

1 B

2 B

2 C

2 D

 

load Client,concat(Product,'-') as NewProduct resident Tablename group by Client;

 

Can you try like above

firstnameunknown
Contributor II
Contributor II
Author

after i added it, after the aggr , lines are all red in errors.

firstnameunknown
Contributor II
Contributor II
Author

it has errors

anat
Master
Master

Test:

Load * inline [

Client, Product

1 ,A

1,B

2,B

2,C

2,D

];

load Client,concat(Product,'-') as NewProduct resident Test group by Client;

firstnameunknown
Contributor II
Contributor II
Author

Hey,  concat name is working but concat emails has errors.

Thank you

anat
Master
Master

What error you are getting