Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nenadvukovic
Creator III
Creator III

How to get a table showing only rows that exist in both tables?

Hi, if I have something like this:

Table1:

Fld, Pd, Val

A, 5-17, 1

B, 5-17, 1

C, 5-17, 2

D, 5-17, 3

Table 2:

Fld, Pd, Val

B, 5-18, 3

D, 5-18, 4

E, 5-18, 3

F, 5-18, 5

And I want to get only this in Table3:

B, 5-17, 1

B, 5-18, 3

D, 5-17, 3

D, 5-18, 4

Thanks

Message was edited by: Nenad Vuković to make it more realistic

1 Solution

Accepted Solutions
nenadvukovic
Creator III
Creator III
Author

Is there a smarter solution:

T1:

load * inline [

Fld, Pd, Val

A, 5-17, 1

B, 5-17, 1

C, 5-17, 2

D, 5-17, 3];

T2:

noconcatenate load * inline [

Fld, Fld1, Pd, Val

B, B, 5-18, 3

D, D, 5-18, 4

E, E, 5-18, 3

F, F, 5-18, 5]

where exists(Fld);

concatenate load * resident T1 where exists(Fld1, Fld);

drop table T1;

drop field Fld1;

View solution in original post

4 Replies
Chanty4u
MVP
MVP

try this

Table1:

l

A

B

C

D

  inner join

Table2:

B

D

E

F

arvind1494
Specialist
Specialist

load * from Table1;

inner join

load * from Table2;

nenadvukovic
Creator III
Creator III
Author

Is there a smarter solution:

T1:

load * inline [

Fld, Pd, Val

A, 5-17, 1

B, 5-17, 1

C, 5-17, 2

D, 5-17, 3];

T2:

noconcatenate load * inline [

Fld, Fld1, Pd, Val

B, B, 5-18, 3

D, D, 5-18, 4

E, E, 5-18, 3

F, F, 5-18, 5]

where exists(Fld);

concatenate load * resident T1 where exists(Fld1, Fld);

drop table T1;

drop field Fld1;