From zero to Analytics pt2: Creating a calculation view with data privacy
So you have setup your SAP HANA, express edition instance to create and expose models using the the HANA Analytics Adapter based on XS Advanced as explained in this previous blog post.
You are now ready to create a model to consume from analytics tools such as SAP Analytics Cloud or Analysis for Office.
Create a model to expose
I recently earned GitHub super powers that allow me to publish approved repositories. So we’ll be using my first (quite conservative) contribution to speed things up.
If you want to do this yourself, there is a step-by-step tutorial that explains how to:
- Create a Multi-Target Application,
- Create a database module,
- Create a table,
- Load data into the table
- Create the calculation view
Some notes you can omit if you have been to the Web IDE before:
- In SAP HANA, express edition, the default URL for Web IDE is https://<your_host>:53075 - If this is your first time visitng SAP Web IDE for SAP HANA and the XS Advanced tooling, I would recommend you take a quick look at this tutorial: https://developers.sap.com/tutorials/xsa-explore-basics.html It will walk you through the basic tooling.
If you prefer to see it working first, get into SAP Web IDE for SAP HANA and let’s get this party started.
Clone a repository
Once in the SAP Web IDE for SAP HANA, right-click on your workspace and choose Git -> Clone Repository
When prompted, use the following URL:
Once the cloning has completed, right click on the project and choose Project Settings
Navigate into Space and set it to development (or whatever space is mapped to a database tenant – we are assuming the prerequisites have been fulfilled)
Save and close.
Here is the difficult part… play some drum roll in your head while you right click on the db folder (NOT the entire project) and ask Web IDE to Build!
And you should see the console firing some logging at you and finally a happy success message:
Explore the Database
With the database explorer! If you look carefully into the console, you will see a lot has happened. Web IDE has created an HDI container, a table, loaded the data and activated a calculation view with K-Anonymity.
(psst.. we’re not using that activate term anymore, we now call it deployed… sorry,I got some se38 nostalgia there…)
Right click on your database module again and let Web IDE take you to your runtime artifacts
Before you can execute, log in to the System database with a power admin (such as SYSTEM or its copy):
Open a SQL console and execute the following:
alter database HXE ADD 'scriptserver';
Now yes, explore that HDI container. You can see your table with data, before it’s anonymized or GDPR compliant:
And you can also see the output of the calculation view with the k-anonymity in place:
The next blog post shows how to setup a user for the HANA Analytics Adapter.
If you want to learn more about K-Anonymity, there are some clarifying drawings on the help.