Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.?
IP | DNS | NetBIOS | Tracking Method | OS | IP Status | QID | Title | Vuln Status | Type | Severity | Port | Protocol | FQDN | SSL | First Detected | Last Detected | Times Detected | Date Last Fixed | CVE ID | Vendor Reference | Bugtraq ID | CVSS | CVSS Base | CVSS Temporal | CVSS Environment | CVSS3 | CVSS3 Base | CVSS3 Temporal | Solution | PCI Vuln | Ticket State | Instance | Category | Associated Tags |
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);
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);