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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Compare 2 table

Greetings,

I've two tables like this:

School1:

Last Name 1Name 1
PeraltaJake
DiazRosa
HoltRay
LinettiGina
BoyleCharles

School2:

Last Name 2Name 2
PeraltaJake
HoltRay
JeffordsTerry
SantiagoAmy

And i would like to get another table which show the difference between them so the result would be like that:

Last Name 1Last Name 2
Diaz-
Linetti-
Boyle-
-Jeffords
-Santiago

Thanks for the answers!

1 Reply
OmarBenSalem
Partner - Champion II
Partner - Champion II

Maybe sthing like this:

School1:

load LastName1,Name1, LastName1 as LastName2 inline [

LastName1, Name1

Peralta, Jake

Diaz, Rosa

Holt, Ray

Linetti, Gina

Boyle, Charles];

School2:

load LastName2 as LastNamev2, Name2 as Namev2

inline  [

LastName2, Name2

Peralta, Jake

Holt, Ray

Jeffords, Terry

Santiago, Amy];

final:

load  LastName2 where not Exists(LastName2);

load  LastNamev2 as  LastName2 Resident School2  ;

NoConcatenate

S20:

load

LastNamev2,Namev2, LastNamev2 as LastvName1 Resident School2;

drop Table School2;

S1:

load LastName1,Name1 Resident School1;

drop Table School1;

Concatenate (final)

load  LastvName1 as LastName1 where not Exists(LastvName1);

load LastName1 as LastvName1,Name1 as Namev1 Resident S1;

S2:

NoConcatenate load LastNamev2 as LastName2, Namev2 as Name2 Resident S20;

drop Table S20;


Result:

Capture.PNG

Capture.PNG