6 Replies Latest reply: Mar 30, 2017 11:19 AM by Sunny Talwar RSS

    compare rows of a dataset

    Paloma Mura

      Good morning,

       

      I want to compare rows from my dataset to unbolt my data from particular columns (here B, C and D).

      For example, I have the table below :

      A     B     C                              D

      1     1B     23/03/2017 12:12     344

      2     2B     23/03/2017 11:50     20

      3     1B     23/03/2017 12:12     344

      4     3B     23/03/2017 09:11    32

      The expected result would be

      - either to delete the row :

      A     B     C                              D

      1     1B     23/03/2017 12:12     344

      2     2B     23/03/2017 11:50     20

      4     3B     23/03/2017 09:11    32

      - or to add a new column E like this :

      A     B     C                              D       E

      1     1B     23/03/2017 12:12     344     1

      2     2B     23/03/2017 11:50     20       1

      3     1B     23/03/2017 12:12     344     0

      4     3B     23/03/2017 09:11    32        1

      I don't know if I need to do it directly in the script or not.

      I wrote something in SQL but I don't know how to adapt it to Qlik Sense or if it is really correct.

      select * from t1

      where t1.A in (select A from t2

                          where t2.B = t1.B

                          and t2.C=t1.C

                          and t2.D=t1.D)

       

      I hope I was clear and someone could help me.

      Thank you,

      Paloma