A video version of this tutorial is also available:
Step 1Create a salary table and load data into it
โ
Using what you learned in Create an SAP HANA Database Project, you will create another database table and load sample data into it but without step by step instructions. Extrapolate what you learned from these same steps in the earlier tutorial to complete this task.
Create a new database table named TGT_SALARIES using the hdbtable artifact type in the data folder. Use the following table definition.
Download this csv file – https://github.com/SAPDocuments/Tutorials/blob/master/tutorials/hana-cloud-calculation-view-differential-privacy/salarydata.csv into your computer. Upload it into the loads folder using the Upload Files option.
Deploy these new Artifacts
Salary Table
Step 2Create a new calculation view
+
Create a new folder called models under db/src. Create a new Calculation View via the SAP HANA: Create SAP HANA Database Artifact command pallet entry.
New calculation view
Call it SALARIES_ANONYMIZED and make it a CUBE. Press Create.
New calculation view
Select the new calculation view file in the Explorer. This will load it into the graphical Calculation View editor. Click on the Projection node and then click on the white canvas to drop it.
New calculation view
Use theplus signon the node to add a table as a data source. Choose TGT_SALARIES
New calculation view
Step 3Complete the calculation View
+
Double click on the Projection_1 node. This will open the mapping. Double click on TGT_SALARIES to add all of the columns to the output
New calculation view
Connect the Projection_1 node to the Aggregation node.
Configure privacy
Double-click on the name of the node to move all the fields into the output columns.
Configure privacy
Go into the Semantics node and switch START_YEAR and ID to attribute
Configure privacy
Deploy
Step 4Configure differential privacy via SQL view
+
Create a view (artifact type hdbview) in the src/models folder named V_SALARIES.
Configure privacy
Use the following syntax to create a SQL view that uses the Differential Privacy Anonymization approach for the SALARY column.
Share feedback on this tutorial or join the conversation in SAP Community.
Submit detailed feedbackDiscuss in Community
Steps
Step 1 of 5
1. Create a salary table and load data into it2. Create a new calculation view3. Complete the calculation View4. Configure differential privacy via SQL view5. Preview data
Joule
AI Notice
Joule is an AI assistant. Generative AI may produce inaccurate, incomplete, or biased information. Always verify important details before acting on them.
Conversations are sent to SAP-hosted large language models for processing. Do not include personal data, credentials, or confidential information in your messages.
Joule's responses are based on the SAP tutorial catalog and may not reflect the latest product changes. For authoritative guidance, consult the linked tutorials and official SAP documentation.