Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to compare values from the same column but different table

Hi,

I have 2 tables, A and B with the same column Fruits. In table A, a fruit may be called banana,apple but in table B it is may be called apple.

For example,

AB
Banana,AppleApple
Orange,PineappleOrange
Banana,PineappleOrange
PineapplePineapple
OrangeOrange

I want to be able to match the columns together if the column in table A contains whatever is in table B. In this case, I want the first 2 rows to be matched together and show the results of table B. Is there any way to do this?

Thanks!

4 Replies
Not applicable
Author

Chan, one more question:

What do you need if two fruits in Table A have records in Table B? For example if Banana & Apple both exists in Table B, do you want associate both rows or first one only?

Not applicable
Author

Hi,

I would like to associate both rows as i need to compare the results in both tables.

Thanks!

jonathandienst
Partner - Champion III
Partner - Champion III

Something like this, perhaps:

LOAD

  Fruits as OriginalFruits,

  Trim(SubField(Fruits, ',')) as Fruits,

  1 as TableA,

  ...

From A ....

Join

LOAD

  Fruits

  1 as TableB

FROM B ....

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi,

I forgot to mention that not all the data in the first table has a comma separating them. Will your method still work?

Also, is there any other way other than using join? I am loading both tables in different sections to identify them properly