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

Joining different but related data

I have one table of data that contains information for two categories, an A and a B. The data is structured as such:

Key Group Name Address City State Country Email....

123 A a b c d e f

123 B a b c d e g

124 A z r q l m c

124 B z rs vn bc wl pq

I am separating these two tables so I have a table that contains all the details for group A and a table that contains all the details for group B. I now wish to join these tables back together by the Key so that I get all of the data on the same line. I qualify the tables when I pull separate them (except the Key and the Group) so that I have A.Name, B.Name, etc... The reason I want to join them so I can things like if(A.Name=B.Name,'same','check_key') where the Keys are the same, etc...

Can someone please help me with how this is accomplished. I have tried joining the tables however because the keys are the same but the groups different I end up with 4 lines for each key, one that is AA, one that is AB, one that is BA and one that is BB. if I qualify the Group, then I get 1 line but with incorrect or incomplete data.

Any advice would be greatly appreciated.

Thank you,

Michael

4 Replies
Not applicable
Author

have you tried just unqualifying Key?

deepakk
Partner - Specialist III
Partner - Specialist III

hi

I hope the attach appplication helps

Not applicable
Author

Unfortunately I am using a shared server developer license and cannot open that file on my desktop, or get it loaded into our development. Could you possibly copy the section of the script which shows how you joined your tables?

Also, in response to previous comments on this chain the "Key" field is unqualified.

Thanks,

Michael

deepakk
Partner - Specialist III
Partner - Specialist III

Below is the script.











test:

LOAD

Key

,

[Group]

,

Name

FROM

(

biff, embedded labels, table is Sheet2$)

;

Qualify

*;

unqualify

Key;

GroupA:

noconcatenate

Load

Key

,

[Group]

,

Name

resident

test Where [Group] ='A'

;

inner

join

Load



Key

,

[Group]

,

Name

resident

test Where [Group] ='B'

;

drop

table

test;