Written by

Integration Engineer at Cognosante
Question Oliver Wilms · May 27, 2020

Read data from Excel

Hello,

I work as a contractor for the Department of Veterans Affairs. I want to read data from an Excel workbook. I searched posts here and saw Apache POI suggested. I believe Apache POI is not approved for use within VA. I also believe we should be able to run SQL query against Excel. Has anybody done such a thing or are there other ways to read data from Excel workbooks?

Thanks

Comments

Oliver Wilms  May 28, 2020 to Vitaliy Serdtsev

Thanks for the suggestion. However I am afraid this is also not an approved tool in my work environment.

0
Robert Cemper · May 28, 2020

if you install Excel you have automatically also a DSN for ODBC access to EXCEL
check your DSN data sources in your Windows installation.
Use ODBC-Gateway in Cache / IRIS to access it. 

0
Oliver Wilms  May 28, 2020 to Robert Cemper

Robert,

I added a DSN for an Excel Workbook ODBC 32-bit was my only option on my laptop. When I go to SQL Gateway Connection, I see other DSN but not my Excel DSN. Maybe I will try %Activate next

0
Oliver Wilms  May 28, 2020 to Oliver Wilms

So I also tried Activate Wizard. Found it in my HealthShare but not in IRIS CE. Once in Activate Wizard, I do not see Excel.

0
Robert Cemper  May 29, 2020 to Oliver Wilms

To use a DSN it has to be a SYSTEM-DSN and have the same bit as Cache /  IRIS.  Depends on your EXCEl instalation
Therefore 64bit.
Activate as you might know from Cache is not available in IRIS

0
alex kosinets · May 28, 2020

Hi Oliver,

(other way)
If you connect the MX virtual excel to your m-database, you can read books very simply:
In an Excel cell, write down the formula
$$ReadSheet c:\myfolder\mybook.xlsb#mysheet ^myGlob(myIndex) *

After starting MX, the specified sheet will be read and converted to global.
On one sheet there are many such formulas.

Or read the entire book at once in ^global, and not just one sheet:
$$ReadSheet c:\mx\mybook.xlsb#* ^myGlob(myIndex, *

And you can work with this globals as you like, write the results in Excel or another way.
MX Works with all Cache or IRIS. 

see also

0
Oliver Wilms  May 28, 2020 to alex kosinets

Alex,

I looked at MX. I added one connection in the Configuration. I am not exactly sure what to do with this tool. However it sure looks interesting, I am working on a dashboard page where I want to frequently read the status of monitored components from an Excel spreadsheet. I think I should be able to collect the data from another file format.

Thanks

0
alex kosinets  May 29, 2020 to Oliver Wilms

Oliver

to check how MX works on your machine
just open file sea-battle-mx.xlsb
and select sea-battle (top big button ).

You will connect to our m-server.

Alex

0
Oliver Wilms  May 28, 2020 to Marc Mundt

Thanks for the suggestion. However I am afraid this is also not an approved tool in my work environment.

0