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: 
aminehaddar
Contributor II
Contributor II

JOIN Problems

Hi,

I have 2 tables:

A:

ID

SEG

RESULT
3
12A1
13B1
14B1

B:

CLIENT_ID

MESURE

1
131

I want to find as a result the difference between the 2 tables:

C:

ID

SEG

RESULT
3
12A1
14B1

Any help please?

Regards,

6 Replies
olivierrobin
Specialist III
Specialist III

hello

what do you mean by difference ?

as I see, the keys are not the same in each table (ID,SEG for A, CLIENT_ID for B)

you could try a join on SEG=CLIENT_ID

and ion a 2nd pass create a flag if RESULT<>MESURE

tresesco
MVP
MVP

May be like:

B:

Load * Inline [

CLIENT_ID, MESURE

,1

13, 1];


A:

Load * Inline [

ID, SEG,RESULT

, ,3

12, A, 1

13, B, 1

14, B, 1

] where not Exists(CLIENT_ID,ID) or len(trim(ID))=0;


Drop Table B;

aminehaddar
Contributor II
Contributor II
Author

Both have the same key, just when I wrote the exemple I made a mistake, Both have the same name : ID.

Regards

olivierrobin
Specialist III
Specialist III

so you can join them using that key

tab:

load * from A;

join(tab)

load CLIENT_ID,MESURE

from B;

tab2:

load *,

if(RESULT<>MESURE,1,0) as flag_error

resident tab;

niclaz79
Partner - Creator III
Partner - Creator III

Loading Inline with a where-condition? Bold move.

tresesco
MVP
MVP

Inline data load is here for non-availability of actual data source and trying to give the OP an idea.