SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Create a Calculation View with Differential Privacy in SAP HANA Cloud

Use differential privacy to anonymize confidential data in SAP HANA Cloud.

Overview

🎓 beginner 20 min. SAP HANABeginnerSAP HANA CloudSAP Business Application Studio

You will learn

  • โœ”How to create Calculation View of type Cube using SAP Business Application Studio
  • โœ”How to configure data anonymization to a column in order to protect sensitive data
Thomas Jung T Thomas Jung March 31, 2023
Created by January 8, 2021
Contributors

Prerequisites

Prerequisites

Steps

Intro

A video version of this tutorial is also available:


Step 1 Create 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.

  1. Create a new database table named TGT_SALARIES using the hdbtable artifact type in the data folder. Use the following table definition.

    SQL
    column table "TGT_SALARIES" (
        ID INTEGER  unique not null COMMENT 'Employee ID',
        SALARY DOUBLE COMMENT 'Salary',
        START_YEAR INTEGER not null COMMENT 'Starting Year',
        GENDER NVARCHAR(1) COMMENT 'Gender',
        REGION NVARCHAR(4) COMMENT 'Region',
        "T-LEVEL" NVARCHAR(200) COMMENT 'T Level',
        PRIMARY KEY ("ID")
    )
    COMMENT 'Employee Salary'
  2. Create the configuration for the csv upload. In the data/loads folder, create a file called salaryload.hdbtabledata with the following content

    JSON
    {
      "format_version": 1,
      "imports": [{
        "target_table": "TGT_SALARIES",
        "source_data": {
          "data_type": "CSV",
          "file_name": "salarydata.csv",
          "has_header": true,
          "dialect": "HANA",
          "type_config": {
            "delimiter": ","
          }
        }
        }]
    }		
  3. 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.

  4. Deploy these new Artifacts

    Salary Table
    Salary Table

Step 2 Create a new calculation view
+
Step 3 Complete the calculation View
+
Step 4 Configure differential privacy via SQL view
+
Step 5 Preview data
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Create a salary table and load data into it 2. Create a new calculation view 3. Complete the calculation View 4. Configure differential privacy via SQL view 5. Preview data

Learn more →