Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
NemoAndStitch22
Contributor III
Contributor III

Load two spreadsheets one and only one has headings

Hiya, 

 

I'm trying to load 4 spreadsheets into Qlik sense, one of the tables has headings and the other 3 don't.

Is there a way to load them in using the 1st spreadsheet's headings? I found a script from qlikview but can't work out how to adapt it for qlik sense. 

It may be as simple as I just need a paths list, but I'm not sure, so all help is welcome.

 

NemoAndStitch22_0-1614347010073.png

 

This is what I've got and then at the end of my data load I have this but it doesn't like it. 

NemoAndStitch22_1-1614347031733.png

 

I have thousands of rows of data and about 30 columns so don't want to have to manually change them in the script.

 

Thanks!!

 

 

 

1 Reply
tm_burgers
Creator III
Creator III

Do all your files have the columns in the same order? 

 

If so, then you could just skip headers all-together.

 

I have written code which checks dynamically checks header size which you would just have to loop

//have found that the header size occassionaly varies depending on how the report was exported, have add the below section to allow for this dynamically.
[getHeader]:
LOAD
    A,
	RowNo() as RowNum
 FROM [$(vFile)]
(ooxml, no labels, table is Report1);

[getHeader_2]:
NoConcatenate LOAD
    A,
	RowNum
Resident CurrentRentRoll_getHeader
where A = 'FIELD_HEADER';

Let vHeaderSize = peek('RowNum',0,'getHeader_2')-1;

drop table getHeader, CurrentRentRoll_getHeader_2;




LOAD   
*
FROM [$(vFile)]
(ooxml, embedded labels, header is $(vHeaderSize) lines, table is Report1)