Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
marebalo
Contributor
Contributor

Exclusive join

hi sorry for my english

How can i do an exclusive outer join?

 

i let a picture that explains better

 

 

1 Solution

Accepted Solutions
lblumenfeld
Partner Ambassador
Partner Ambassador

The was this is done is not really a join, but simulates one...

First I'll create two tables in my app (you already have two tables.)

Table1:
Load * Inline [
T1_ID, Field1
1, A
2, B
4, D
];

Table2:
Load * Inline [
T2_ID, Field2
1, X
3, Y
4, Z
];

 

This is the script that will do the Exclusive Outer Join of Table1 and Table2...

-------------

 

CombinedTable:
Load
   T1_ID as ID,
   Field1
Resident Table1
Where not Exists(T2_ID, T1_ID);

Concatenate (CombinedTable)

Load
   T2_ID as ID,
   Field2
Resident Table2
Where Not Exists(T1_ID, T2_ID);

Drop Tables Table1, Table2;

-------------

Now, CombinedTable will contain:

ID       Field1       Field2
2         B
3                             Y

 

I hope this helps.

View solution in original post

1 Reply
lblumenfeld
Partner Ambassador
Partner Ambassador

The was this is done is not really a join, but simulates one...

First I'll create two tables in my app (you already have two tables.)

Table1:
Load * Inline [
T1_ID, Field1
1, A
2, B
4, D
];

Table2:
Load * Inline [
T2_ID, Field2
1, X
3, Y
4, Z
];

 

This is the script that will do the Exclusive Outer Join of Table1 and Table2...

-------------

 

CombinedTable:
Load
   T1_ID as ID,
   Field1
Resident Table1
Where not Exists(T2_ID, T1_ID);

Concatenate (CombinedTable)

Load
   T2_ID as ID,
   Field2
Resident Table2
Where Not Exists(T1_ID, T2_ID);

Drop Tables Table1, Table2;

-------------

Now, CombinedTable will contain:

ID       Field1       Field2
2         B
3                             Y

 

I hope this helps.