1 Reply Latest reply: Aug 24, 2018 5:04 AM by omar bensalem RSS

    Compare 2 table

    Vincent Bellanger

      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!

        • Re: Compare 2 table
          omar bensalem

          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