Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
bobbydave
Creator III
Creator III

Load file but eliminate redundant data

I have a requirement to load  a file but its a dynamic file which will change each month.

I need to remove a certain number of redundant data from this file and load the data that is left behind or in another sense, I need to start on a certain line.

Right now, I start on line 307 of an excel file with the below headings. Next month it might start on a different line with the same headings as below. How can I tell qlikview to start on that header and eliminate the data above the header.?

   

IPDNSNetBIOSTracking MethodOSIP StatusQIDTitleVuln StatusTypeSeverityPortProtocolFQDNSSLFirst DetectedLast DetectedTimes DetectedDate Last FixedCVE IDVendor ReferenceBugtraq IDCVSSCVSS BaseCVSS TemporalCVSS EnvironmentCVSS3CVSS3 BaseCVSS3 TemporalSolutionPCI VulnTicket StateInstanceCategoryAssociated Tags
1 Solution

Accepted Solutions
m_woolf
Master II
Master II

This is the script that I used to find the header location in a csv file:

// data doesn't always start at same row

FindDataHeaderTemp:

First 500   // set this value large enough that the Header can be found

load

if(@1='IP',rowno()) as Header   //@1 will probably be A in an Excel load

From

'$(File)'

(txt, codepage is 1252, no labels, delimiter is ',', msq);

FindDataHeader:

NoConcatenate load

Header

resident FindDataHeaderTemp

where Header>0;

drop table FindDataHeaderTemp;

vDataHeader = peek('Header');

drop table FindDataHeader;

// end data start

Data:

LOAD

Whatever...

FROM

'$(File)'

(txt, codepage is 1252, no labels, delimiter is ',', msq, header is $(vDataHeader) lines);

View solution in original post

1 Reply
m_woolf
Master II
Master II

This is the script that I used to find the header location in a csv file:

// data doesn't always start at same row

FindDataHeaderTemp:

First 500   // set this value large enough that the Header can be found

load

if(@1='IP',rowno()) as Header   //@1 will probably be A in an Excel load

From

'$(File)'

(txt, codepage is 1252, no labels, delimiter is ',', msq);

FindDataHeader:

NoConcatenate load

Header

resident FindDataHeaderTemp

where Header>0;

drop table FindDataHeaderTemp;

vDataHeader = peek('Header');

drop table FindDataHeader;

// end data start

Data:

LOAD

Whatever...

FROM

'$(File)'

(txt, codepage is 1252, no labels, delimiter is ',', msq, header is $(vDataHeader) lines);