Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
a_perr
Contributor
Contributor

Display IDs from a table A that don't have an equivalent in table B

Hello all,

I have 2 tables A and B, linked by a third "join" table, under the following pattern:

TableA ("ID_A": A1, A2, ...)

TableJoin("ID_A":A1,           A2,          ...

                     "ID_B":B127,      B213,      ...)

TableB ("ID_B": B1, B2, ...)

 

My goal is to create two tables, one from TableA displaying all the ID_A lines that don't have an ID_B associated in TableB, and vice versa.

 

Do you have any tip as to how to do that?

 

If I had a TableC with ID_A keys (no TableJoin), would the process be similar?

 

1 Reply
Vegar
MVP
MVP

Lets say you have this datamodel

SET NullInterpret  = '';  //To get correct null() values from inline table
A:
load * INLINE [
ID_A
A1
A2
A4
];

B:
load * INLINE [
ID_B
B1
B3
B4
];


LINK:
LOAD * INLINE [
ID_A, ID_B
A1, B1
A2, 
  , B4
A4, B4
];

Then you can use these expression to fetch how many IDs are without a link.

=COUNT({-$<ID_B = {"*"}>}ID_A)

=COUNT({-$<ID_A= {"*"}>}ID_B )