2 Replies Latest reply: Dec 20, 2015 6:36 PM by Sunny Talwar RSS

    Create a new field in a table if exist values in another table

    Filiberto Cacciari

      Ho everyone,

       

      what i would like to do is to create a new field in the first table if exist values in another table.

       

      Table1:

      LOAD * INLINE [

          A

          1

          2

          3

          4

          5

          6

          7

          8

      ];

       

      Table2:

      LOAD * INLINE [

          A

          2

          3

          4

          10

          11

          12

      ];

       

      What I'd like to do is to create a "B" field in the Table1 where the values are:

      - "OK" if the value in the field A of Table1 exist in the field A of Table2;

      - "KO" if the value in the field A of Table1 does not exist in the field A of Table2.

       

      Is that clear enough?

      The field "B" in the "New" Table1 should be:

      B

      KO

      OK

      OK

      OK

      KO

      KO

      KO

       

      Here attached my qvw example.

      Thank u all.

       

      Filiberto