10 Replies Latest reply: Nov 16, 2012 4:09 AM by Arya v RSS

    joining two tables

      Hi everyone,

             could you please help me with this issue.

       

      i have two tables

       

      table1:

      ID
      AB
      12060
      23025
      41011

       

      TABLE 2:

      ID
      AC
      33350
      53043
      62126

       

      AND I NEED THIS

      IDA
      BC
      12060
      23025
      333
      50
      41011
      530
      43
      621
      26

       

      THANKS!

      gerardo

        • Re: joining two tables
          Anand Chouhan

          Hi,

           

           

          Write script like

           

          table1:

          Load * inline

          [

          ID,  A,   B

          1,   20,  60

          2,   30,  25

          4,   10,  11

           

           

          ];

           

           

          TABLE2:

           

          JOIN

           

          load * inline

          [

          ID, A,   C

          3,  33,  50

          5,  30,  43

          6,  21,  26

          ];

           

           

          Put Join between two tables.

           

          Regards,

          Anand

          • Re: joining two tables
            marco masin

            concatenate(table1)

             

            LOAD *

            Resident TABLE 2;

              • Re: joining two tables

                hI marco,

                      i did it but the script generated a $syn table with %key_ID+%key_A fields

                 

                 

                what can i do with this?

                thanks

                  • Re: joining two tables
                    marco masin

                    tabella1:

                    LOAD* inline

                    [

                    ID, A, B

                    1, 20, 60

                    2, 30, 25

                    4, 10, 11

                     

                     

                    ];

                     

                     

                    concatenate(tabella1)

                    LOAD* inline

                     

                    [

                    ID, A, C

                    3, 33, 50

                    5, 30, 43

                    6, 21, 26

                    ];

                      • Re: joining two tables

                        hi! i tried with outer join and concatenate but the result was this

                         

                        table1.idtable2.idabc






























                         

                        but i need this:

                        idabc
















                         

                         

                        this is my load script

                         

                        pagos:

                        LOAD actualizacion,

                             baja,

                             comentario,

                             direccion,

                             email,

                             estado,

                             estado_pago_gateway,

                             fecha,

                             generacion,

                             id_pago,

                             id_pago AS %Key_PAGO_ID,

                             id_pago_dm,

                             medio_pago,

                             metodo_pago,

                             moneda,

                             monto,

                             monto_neto,

                             num_transaccion

                        FROM

                        [C:\QlikView-MG\QVD\PAGO_DM.QVD]

                        (qvd);

                         

                        outer join

                         

                        LOAD acc_id,

                             actualizacion,

                             baja,

                             estado_pago_gateway,

                             extra_part,

                             generacion,

                           id_pago,

                             id_pago AS %Key_PAGO_ID,

                             id_pago_mp,

                             item_id,

                             mp_op_id,

                             name,

                             payment_method,

                             price,

                             shipping_amount,

                             status,

                             status_description,

                             total_amount

                        FROM

                        [C:\QlikView-MG\QVD\PAGO_MP.QVD]

                        (qvd);

                         

                        what im doing wrong?

                         

                        thanks!

                          • Re: joining two tables
                            marco masin

                            pagos:

                            LOAD actualizacion,

                            baja,

                            comentario,

                            direccion,

                            email,

                            estado,

                            estado_pago_gateway,

                            fecha,

                            generacion,

                            id_pago,

                            id_pago AS %Key_PAGO_ID,

                            id_pago_dm,

                            medio_pago,

                            metodo_pago,

                            moneda,

                            monto,

                            monto_neto,

                            num_transaccion

                            FROM

                            [C:\QlikView-MG\QVD\PAGO_DM.QVD]

                            (qvd);

                             

                            concatenate(pagos)

                             

                            LOAD acc_id,

                            actualizacion,

                            baja,

                            estado_pago_gateway,

                            extra_part,

                            generacion,

                            id_pago,

                            id_pago AS %Key_PAGO_ID,

                            id_pago_mp,

                            item_id,

                            mp_op_id,

                            name,

                            payment_method,

                            price,

                            shipping_amount,

                            status,

                            status_description,

                            total_amount

                            FROM

                            [C:\QlikView-MG\QVD\PAGO_MP.QVD]

                            (qvd);

                    • Re: joining two tables

                      Hi

                       

                      concatenate between two tables

                       

                      if the field name is same in both the tables

                       

                      id in both the tables

                      if ur result is like

                      t1.id,t2.id  --

                      for this  use the unqualify

                       

                      or

                       

                      use alias to change ur field name to id