5 Replies Latest reply: Nov 26, 2014 10:50 AM by Ruben Marin RSS

    Delete first row on load

      Hi,

       

      I have 5 fields and I want to delete the first row at 4 out of those 5 fields. Also, I want to do this when data is loaded. How can I do this?

       

      Thanks,

      Adrian

        • Re: Delete first row on load
          Friedrich Hofmann

          Hi Adrian,

           

          and what about the 5th field? If you delete the first row for 4 out of 5 fields, where should #5 go?`

          You could just load it, then do a RESIDENT LOAD of only the 1st line (with the keyword FIRST 1) - take care that the tables do not link - and do another RESIDENT LOAD from the first table with a WHERE NOT EXISTS() clause pointing to the "one-record-table".

          HTH

           

          Best regards,

           

          DataNibbler

            • Re: Delete first row on load

              Field #5 is fine, nothing has to be deleted from there.

               

              Also, you lost me. I'm new to QV. Could you write a dummy code with what you said?

               

              Adrian

                • Re: Delete first row on load
                  Bill Markham

                  Do you mean that you want to delete the 1st field or the first row ?

                   

                  Could you paste in your current script for the load ?

                    • Re: Delete first row on load

                      LOAD [Data Availability as per SLA] as Feed,

                           F2 as Week_Ending,

                           F4 as Scheduled,

                           F5 as Achieved,

                           F6 as Reason

                      FROM

                      [C:\Users\ac834435\Desktop\Weekly SLA Metrics\Copy of CBS BAS_EU_Service Metrics_Calc_SNT_17-Nov to 23-Nov.xlsx]

                      (ooxml, embedded labels, table is [Cube Availability]);

                       

                      This is my load script. Basically, I want to delete the first row from Feed, Week_Ending, Scheduled, Achieved.

                       

                      Thanks

                        • Re: Delete first row on load
                          Ruben Marin

                          LOAD If(RowNo()>1, [Data Availability as per SLA]) as Feed,

                               If(RowNo()>1,F2) as Week_Ending,

                               If(RowNo()>1,F4) as Scheduled,

                               If(RowNo()>1,F5) as Achieved,

                               F6 as Reason

                          FROM

                          [C:\Users\ac834435\Desktop\Weekly SLA Metrics\Copy of CBS BAS_EU_Service Metrics_Calc_SNT_17-Nov to 23-Nov.xlsx]

                          (ooxml, embedded labels, table is [Cube Availability]);