Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
rubenmarin

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

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

View solution in original post

5 Replies
datanibbler
Champion
Champion

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

Not applicable
Author

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

Anonymous
Not applicable
Author

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 ?

Not applicable
Author

LOAD [Data Availability as per SLA] as Feed,

     F2 as Week_Ending,

     F4 as Scheduled,

     F5 as Achieved,

     F6 as Reason

FROM

(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

rubenmarin

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

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