You are on page 1of 11

The Trick with the Excel Master

Workbook
You can use Excel as a database for QMF for Workstations. To do so you have to connect Excel
to QMF for Workstation. This way, each Workbook serves as a Host and each Sheet (or Range)
is a table.
Unfortunately, you have to create a new ODBC connection for each workbook.
The trick is to create one workbook, one ODBC and all input workbooks in one Host. In
addition, by extension, different sources can easily be joined.
The new created Excel Master is the vehicle. Copying the data you want to use as table in
QMF for workstation into this vehicle prevents you from setting up a new ODBC connection
each time the data changes. You connect your Excel Master workbook to one or several input
files (.xlsx). In case that you update the input file you only need to refresh the data in the
Excel Master workbook and you can use the updated table in QMF for Workstation.
Please find here the detailed description on the set up of the Excel Master and the connection
with QMF for Workstation:

Pre-requisites:
Excel:
a) At first you need a Master Excel Workbook. Save a new Excel workbook (named
Excel_Master.xlsx) into your datafolder (e.g. C:\Datenbanken) and close the file.
Caution!! This is only working with XLSX workbooks (Microsoft Excel 2010).

ODBC:
b) Create an ODBC connection to your Master Excel Workbook. Open the ODBC32
application.
(If you do not have any ODBC 32 Shortcut create it with this program path:
C:\Windows\SysWOW64\odbcad32.exe)
On Tab User DSN click Add

Gerald Mandl

IBM use only

09.01.2015

Select the Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb) and press Finish

Type in a Data Source Name (e.g. Excel_Master) and press Select Workbook

Search for the Excel Workbook you have created in Step a), select it and press OK

Gerald Mandl

IBM use only

09.01.2015

Check your input and press OK. Close all other ODBC windows with OK.

You should now see the new connection to your Excel Master Workbook on tab User
DSN. Close the window with OK.

Gerald Mandl

IBM use only

09.01.2015

Excel:
c) Add data into the Excel Master Workbook
Open your workbook, open a new sheet, place your cursor on cell A1, select DATA
icon Connections or Existing Connections (depending on whether you have
already created a connection already or not Proceed with description (1) to find
the procedure for Connections or proceed with description (2) for Existing
Connections)

(1)Icon Connections (if you do not have created a connection before)


Click on Connections

Click Add

Select Browse for More

In the next Window you can search and select an Input Workbook
Proceed with further details on the selection of the Input workbook on d).

Gerald Mandl

IBM use only

09.01.2015

(2)Icon Existing Connections (if you have created a connection already


before)
Click on Existing Connections

Select Browse for More

In the next Window you can search and select an Input Workbook
Proceed with further details on the selection of the Input workbook on d).

Gerald Mandl

IBM use only

09.01.2015

d) Select the data from your Excel Input File


Now search for the workbook you would like to draw your details from for the Excel
Master.
Caution!! Only XLSX Workbooks can be selected
Select the file and click OK

In the next window you see all sheets, tabs or ranges of your Input Workbook. Select
the one with your data and press OK.

Click OK

Caution!! The dataset must start in Cell A1. The column headings must be
in the first row

Gerald Mandl

IBM use only

09.01.2015

Data is created:

Name the sheet-tab within the Excel Master


All sheet tabs Names or Range-Names you will see in QMF for Workstations as table
Caution: The sheet in the Input Excel file must always have the same name like
once used for the definition of the connection within the Excel Master sheet.
Otherwise the link is broken and no data is updated. In this case a new connection
has to created like described in step c.

You can repeat these steps for any dataset you need for your work in QMF for
Workstations.
Every time your Input Workbook is changed, you only have to Refresh the dataset in
your Excel Master workbook.

Gerald Mandl

IBM use only

09.01.2015

QMF for Workstations


e) Set up the Excel Master workbook as data source in QMF for Workstation
Open QMF for Workstations. Right click on Relational Data Sources New
Relational Data Source

Enter a Data Source Name (e.g. Excel_Master). Select the Sun JDBC-ODBC Driver

On JDBC URL select jdbc:odbc:{ODBC_ALIAS} and overrite :{ODBC_ALIAS}


with the ODBC Name, which you have created in Step b

Gerald Mandl

IBM use only

09.01.2015

Press Set User Information and remove the check at User ID and password
are required
Press OK

Press Test Connection. If the connection is established, press OK Next


Finish

Now the new data source is available.

Gerald Mandl

IBM use only

09.01.2015

f) Work with the new data sets from your Excel Master
Double click on the required table name, e.g. Test$
Caution !!! In case of several sheets within the Excel Master all sheets are displayed
twice. Once as sheetname and once as sheetname with data range.

Press Run Query

Caution !!! To open the table within QMF for Workstation the Excel Master workbook
has to be closed.
Results:

You may have a problem with numeric fields:

This is not an error!! You only have to change the Format. Click right on the
Column Header and select Format.

Gerald Mandl

IBM use only

09.01.2015

Choose the right format (e.g. Decimal) and press OK

Gerald Mandl

IBM use only

09.01.2015

You might also like