Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Re: Delete first row on load

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]);

5 Replies
datanibbler
Esteemed Contributor

Re: Delete first row on load

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

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

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

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

(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

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]);

Community Browser