3 Replies Latest reply: Jul 21, 2014 6:39 AM by Anand Chouhan RSS

    Resident Load

      Hi All,

       

      I am struggling with the following code, can anyone assist in letting me know where I am going wrong. Its the resident load bit that's not quite working. Also when doing an order by, can I use the aliases from the previous table?

       

      Data1:

      LOAD [Submission Id],

           [Fieldworker Name] as [Field staff],

           [Fieldworker Id],

           [Received Date],

           gps_conf,

           gps_conf_Location_Longitude,

           gps_conf_Location_Latitude,

           gps_conf_Location_Altitude,

           gps_conf_Location_Time,

           Bike,

           Issue,

           Odometer,

           Km as Reading,

           Date,

           [Adjstd Km],

           Mileage

         

      FROM

      [C:\Odometer Data.xlsx]

      (ooxml, embedded labels, table is [1 Rainfall Odometer])

      WHERE(Year(Date) = '2014' And Mileage > '0' And Mileage < '10000');

       

      Data:

      NoConcatenate

      LOAD *

      Resident Data1

      Order by [Fieldworker Name] asc, Date asc,Km asc;

       

      Thank you

       

      H

        • Re: Resident Load
          Anand Chouhan

          Write load script like below script and  asc one time only

           

          Data1:

          LOAD [Submission Id],

               [Fieldworker Name] as [Field staff],

               [Fieldworker Id],

               [Received Date],

               gps_conf,

               gps_conf_Location_Longitude,

               gps_conf_Location_Latitude,

               gps_conf_Location_Altitude,

               gps_conf_Location_Time,

               Bike,

               Issue,

               Odometer,

               Km as Reading,

               Date,

               [Adjstd Km],

               Mileage

           

          FROM

          [C:\Odometer Data.xlsx]

          (ooxml, embedded labels, table is [1 Rainfall Odometer])

          WHERE(Year(Date) = '2014' And Mileage > '0' And Mileage < '10000');

           

          Data:

          NoConcatenate

          LOAD *

          Resident Data1

          Order by

          [Field staff],Date, Reading asc;

           

          DROP Table Data1;

           

          Note:- [Fieldworker Name] filed get renamed to [Field staff] so use the new name and also Reading, and drop the previous table other wise it is created synthetic keys.