Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trying to load an excel file with a title row above the column heading row

i am trying to load an excel file into qlikview that has been generated by another system.  The first row is a multi-column header with an extra column  that doesn't appear in the main data portion.  when i delete the 1st row in the script as garbage, i lose all the column headings in the second row, as well as all of my data after loading.  the only way i seem to be able to load the data is to manually delete the 1st row in excel, which i don't want to do every time i reload - i am pretty sure that qlikview is able to manage the file as generated but i can't seem to make it work?  can anyone please help?  if this is not the right forum, please help ,as i can't see any other place to post a question.  thank you.

11 Replies
lironbaram
Partner - Master III
Partner - Master III

ok

after playing a little bit

here is a script , your version of excel is not regular so you need to load the file via odbc

then play with the data to find the headers

here is the script according to the file you gave me

ODBC CONNECT32 TO [test;DBQ=C:\Users\Liron\Downloads\Inbound Order Details xx.xls];

////////////////////loading the data/////////////////////////////////////////

DataTemp:

load rowno() as Rownumber,*

     ;

SQL SELECT *

FROM `C:\Users\Liron\Downloads\Inbound Order Details xx`.`'Inbound Orders Details$'`;

//////////////////loading the header line

QUALIFY *;

headersTemp:

load *

Resident DataTemp

where Rownumber=1;

store headersTemp into headersTemp.qvd;

drop table headersTemp;

UNQUALIFY *;

Hedears:

CrossTable(Name, Data)

LOAD headersTemp.Rownumber,

     [headersTemp.Inbound Orders Details],

     headersTemp.F2,

     headersTemp.F3,

     headersTemp.F4,

     headersTemp.F5,

     headersTemp.F6,

     headersTemp.F7,

     headersTemp.F8,

     headersTemp.F9,

     headersTemp.F10,

     headersTemp.F11,

     headersTemp.F12,

     headersTemp.F13,

     headersTemp.F14

FROM

(qvd);

FieldNameMap:

mapping load mid(Name,index(Name,'.')+1,len(Name)-index(Name,'.')) As OldName,Data AS NewName Resident Hedears;

Rename Fields using FieldNameMap;

Data:

NoConcatenate Load * Resident DataTemp where Rownumber>1;

drop table DataTemp,Hedears;

drop Field Rownumber;

Not applicable
Author

ok - not sure what you mean by my version of excel not being regular - it's excel right? anyway if this is a solution, it's way too complicated and I don't understand what this is doing - will have to figure out another way to do this ... thanks anyway