Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Stored Procedure for spreadsheet

Hi,

I am developing a stored procedure to take a data from a spreadsheet and use it to create QVD's.

What I have done is created a spreadsheet Column 1 - Table name 2 - Field List 3- QVD name.

Does anyone know how I would read the data from this spreadsheet into my procedure?

Mckay

3 Replies
IAMDV
Master II
Master II

Do you want SQL Syntax or Qlikview Load Script to read the stored procedure? What flavour of SQL are you using?

Cheers - DV

Not applicable
Author

Thanks for the reply DV

I've got a store procedure at the minute but Im trying to use that stored procedure to read in from a spreadsheet.

What I want is to read the Table name from the spreadsheet then the procedure will search for them in the database and take the selected fields from the spreadsheet and store that with the QVDFileName associated.

Im using Oracle database.

Script is

connectionstring= 172###########

Spreadsheet:

LOAD

TABLENAME,

FIELDLIST,

QVDFILENAME

From$(Data_Path)Spreadsheet.xls

//Procedure

sub Load_Table($(TABLENAME), $(FIELDLIST), $(QVDFILENAME))

LOAD *

Resident Spreadsheet;

$(TABLENAME):

SQL SELECT $(FIELDLIST)

FROM $(TABLENAME)

STORE $(TABLENAME) into $(Data_Path)$(QVDFILENAME);

call sub Load_Table($(TABLENAME), $(FIELDLIST), $(QVDFILENAME);

end sub;


But I just cant get it to work.

mike_garcia
Specialist
Specialist

To Read the Table Name from the spreadsheet, or a list of fields, you need to create a connection via ODBC to the Excel File, then execute the SQLTables; command, which will give you a list of Tables and some attributes.

SQLColumns; will give you a list of fields.

Then, use Disconnect or simply place the new connection string to the SQL DataBase (which will in turn disconnect the previous connection) and execute the store procedure.

Mike.

Miguel García
Qlik Expert, Author and Trainer