Background
For decades, Microsoft Excel remains as the tool of choice to many users for data analysis. Even In the modern BI era, the "Export to Excel" is a must-have feature to many BI tools. In HANA world, we could hear the question from time to time inquiring how to connect Excel to HANA. This blog aims at introducing a new way, which is also completely free, to connect Excel to HANA. It overcomes the limitations of existing methods, and can be a great companion to HDBStudio to improve the interactive HANA data query and analysis through Excel.
Review of existing options
Currently, there are these popular methods to connect Excel to HANA, all with help of HANA Client: 1) the ODBC way, 2) the MDX way, 3) the ODATA way.
Let's have a quick look at these approaches and their limitations. The detailed walk-through steps can be found in plenty of guides online, and will not be repeated here.
The assumption here is that HANA Client is installed on Windows already.
ODBC way
The ODBC way requires setting up the ODBC DataSource leveraging HDBODBC driver. Then, Excel uses Microsoft Query to communicate with HANA through the ODBC driver. The data flow is
[HANA] -> [ODBC driver] -> [Microsoft Query] -> Excel
The use experience is not ideal. First, we encounter such warning message from Microsoft Query.
The user name and password information is saved in the "<connection_name>.dsn" files. The lack of encryption of passwords could a problem from IT security compliance standpoint.
Next, once we proceed, the "Table Options" dialog is rather difficult to navigate with all the unresizeble tiny areas, especially when there are a lot of schema to select:
Once we are at the next screen to define filters, we will notice there are fixed space for up to 3 filter criteria only.
Once we are done with the configuration and proceed to the last step to run the query, many times we could encounter such error message, which makes us wonder if Unicode can be handled properly here.
Another issue we noticed is that Microsoft Query complains with error "Data Truncated" when making ODBC connection to certain HANA revisions (including latest HANA Express), but some older revisions are fine. More investigation is required to identify the root cause, but for now, the fact is that there are cases the connection cannot even be established.
When connection and object configuration are defined successfully, the HANA data querying functionality feels OK. The challenge is mostly with the user experience, efficiency, and bugs like those shown above.
MDX Provider way
This approach utilizes Excel's Data Connection Wizard to connect to HANA cubes e.g. calculation views and analytical views. It is a solid data provider which does not have those disruptive user experience issues encountered in the MSQuery/ODBC way, but by design it is for dimensional data analysis only, not for querying on content objects like tables/views/synonyms.
ODATA way
The ODATA way requires the setup of an ODATA project in HDBStudio and activate the ODATA service endpoint. Then, Excel can connect to the ODATA URI. By design, this is a development effort which runs like a small project, If there is requirement to access another object in HANA, we will go through this development and release cycle again. So, by design this is not meant to be a self-service style data exploration, but a project oriented delivery which requires delivery cycle. For the requirement of limited data exposure through managed interfaces, this is the best choice.
A New Way to connect Excel and HANA
There is another way to bridge Excel and HANA, using AecorSoft Reporting HANA Edition which is a free software, functioning as an Excel Add-In.
It is a small foot-print installation for Excel. Under the hood ,it utilizes HANA Client's ADO.NET data provider to communicate with HANA system.
After installation, Excel will have a new ribbon menu
Define Connection
First step is to define the HANA system connection, by clicking the "Connection Manager" button.
Define Task
Next, use "Report Task Manager" button to bring up the dialog for Task, proceed with "New" button to start defining a new task. Right now, all three catalog objects (Table, View, Synonym) are supported.
Select the connection just created, choose the object type (table or view or synonym), specify the object name (use wildcard if needed), and click "Search".
Here, we can browse the basic metadata information of the object. Highlight the object we want to work with and click "Finish"
Task configuration and definition in Excel pane
Now the object metadata is brought to the Excel pane like this. It is also a great way to inspect the object column type and length information.
If the HANA object columns has Comments defined in its metadata table, then they will show up here as descriptions. The columns in the "Column Order" section can be re-arranged through drag-n-drop.
The task name can be renamed by double-clicking on the "Task Name" text box.
Filter
Filters can be defined through right clicking on the field either in the "Metadata" section or the "Column Order" section.
Once defined, it looks like this in the Filter section:
.
Load Data to Excel
Once everything is defined, the last step is to simply to click the "Load to sheet" button.
During data loading, the progress is shown in the bottom of the pane
.
If users don't have authorization to view data, then there is error message stating the insufficient privilege. The security and authorization depend on the actual security model defined in HANA.
Local storage of task and connection information
There are two ini files under %appdata%\Roaming\AecorSoftReporting folder:
- AecorSoftHANATasks.ini
- AecorSoftHANASourceConnections.ini
The passwords are encrypted.
Conclusion
Here, we have reviewed the existing Excel/HANA integration options and.a new way of connecting Excel to HANA. Please share feedback or feature request in comments.