5 Replies Latest reply: Jun 27, 2014 9:13 AM by partha sp RSS

    Joining tables

      I Have:

       

      Expenses_CarKm:

       

        load

        YearMonth,

        YearMonth & ProfitKmCarNumber As YearMonthCar,

        (ProfitKmEnd - ProfitKmStart) As ProfitKmTotal,

        ProfitKmDrive As ProfitKmDrive,

        (ProfitKmEnd - ProfitKmStart) - ProfitKmDrive As ProfitKmEmpty;

       

      from excel file

       

      And I Have:

       

      TESTING:

       

      LOAD YearMonth,

           [מספר רכב] As ProfitMainCarNumber,

           [סה"כ עלות] As ProfitMainTotal

      FROM

      [D:\(Modular BS)\(Dev)\(Y-IT)\FleetAnalayzer™\PROFIT.xlsx]

      (ooxml, embedded labels, table is [תחזוקה וחלפים]);

       

      how do i join Expenses_CarKm and Testing??

        • Re: Joining tables
          Gysbert Wassenaar

          Using the JOIN keyword:


          Expenses_CarKm:

           

            load

            YearMonth,

            YearMonth & ProfitKmCarNumber As YearMonthCar,

            (ProfitKmEnd - ProfitKmStart) As ProfitKmTotal,

            ProfitKmDrive As ProfitKmDrive,

            (ProfitKmEnd - ProfitKmStart) - ProfitKmDrive As ProfitKmEmpty;

          from ...excel_file...;

           

          JOIN (Expenses_CarKm)

           

          LOAD YearMonth,

               [מספר רכב] As ProfitMainCarNumber,

               [סה"כ עלות] As ProfitMainTotal

          FROM

          [D:\(Modular BS)\(Dev)\(Y-IT)\FleetAnalayzer™\PROFIT.xlsx]

          (ooxml, embedded labels, table is [תחזוקה וחלפים]);

            • Re: Joining tables

              I alredy loaded the first excel table in different place and i called it Expenses_CarKm

               

              and i don't want to load it again.

               

              i just want to join

              LOAD YearMonth,

                   [מספר רכב] As ProfitMainCarNumber,

                   [סה"כ עלות] As ProfitMainTotal

              FROM

              [D:\(Modular BS)\(Dev)\(Y-IT)\FleetAnalayzer™\PROFIT.xlsx]

              (ooxml, embedded labels, table is [תחזוקה וחלפים]);

               

              with Expenses_CarKm fileds.

                • Re: Joining tables
                  Josh Abbott

                  Join (Expenses_CarKm)

                  LOAD YearMonth,

                       [מספר רכב] As ProfitMainCarNumber,

                       [סה"כ עלות] As ProfitMainTotal

                  FROM

                  [D:\(Modular BS)\(Dev)\(Y-IT)\FleetAnalayzer™\PROFIT.xlsx]

                  (ooxml, embedded labels, table is [תחזוקה וחלפים]);

                    • Re: Joining tables
                      Mohamed Ahid

                      Hi

                      try this :

                       

                      TESTING:

                       

                      LOAD YearMonth,

                           [מספר רכב] As ProfitMainCarNumber,

                           [סה"כ עלות] As ProfitMainTotal

                      FROM

                      [D:\(Modular BS)\(Dev)\(Y-IT)\FleetAnalayzer™\PROFIT.xlsx]

                      (ooxml, embedded labels, table is [תחזוקה וחלפים]);

                       

                      join(TESTING)

                       

                        load

                        YearMonth,

                        YearMonthCar,

                        ProfitKmTotal,

                        ProfitKmDrive,

                        ProfitKmEmpty;

                       

                      resdient  Expenses_CarKm;

                       

                      Hope it helps

                • Re: Joining tables
                  partha sp

                  Hi,

                   

                  It"s not a problem.. the both tables should exists in the script... then use join  keyword for joining your table like below

                   

                  Join (Expenses_CarKm)

                  LOAD YearMonth,

                       [מספר רכב] As ProfitMainCarNumber,

                       [סה"כ עלות] As ProfitMainTotal

                  FROM

                  [D:\(Modular BS)\(Dev)\(Y-IT)\FleetAnalayzer™\PROFIT.xlsx]

                  (ooxml, embedded labels, table is [תחזוקה וחלפים]);