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 Anonymized Views Using Differential Privacy

Create an anonymized view in SAP HANA Cloud using Differential Privacy to protect sensitive information.

Overview

🎓 beginner 5 min. SAP HANA CloudBeginnerSAP HANA CloudSAP HANA Database

You will learn

  • โœ”How to create an anonymized view using differential privacy
  • โœ”How to view the results of anonymization
  • โœ”How to run an example scenario using differential privacy
Hui Li H Hui Li January 31, 2025
Created by August 16, 2021
Contributors

Prerequisites

Prerequisites

  • It’s recommended that you complete the previous tutorial.
  • You can download the sample CSV file to run the example scenario. Make sure to upload it into your database before running the queries given in the example.
  • If you would like to run the sample scenario, you need a running instance of SAP HANA Cloud, SAP HANA database in trial or production.

Steps

Intro

Disclaimer

In most cases, compliance with data privacy laws is not a product feature. SAP software supports data privacy by providing security features and specific functions relevant to data protection, such as functions for the simplified blocking and deletion of personal data. SAP does not provide legal advice in any form. The definitions and other terms used in this guide are not taken from any given legal source.


Step 1 Introduction to differential privacy
โ€”

Now that you know the anonymization methods of K-Anonymity and L-Diversity, we will show you in this article how to apply a third method of anonymization.

Differential privacy will add random noise to numerical values based on a mathematical formula that keeps trends of data intact.

The idea behind differential privacy is that individual values can have a different impact on a dataset resulting in privacy breaches. For example, in a dataset containing salaries, the single highest salary value will significantly affect the result when querying the mean salary. If this person is removed from the dataset, the mean salary will change drastically. This way, the salary of that person could be inferred.

To avoid this, differential privacy uses a mathematical formula that contains two parameters:

  • Sensitivity: How much of an impact can one value have on query outcomes? This can be determined by the highest possible value minus the lowest possible value. For salaries ranging from 0 to 100.000, it would be 100.000. For rating scales from 1-7, it would 6. The higher the sensitivity, the more noise is applied to data. But it should not be set higher than necessary because it will otherwise reduce the quality of data.

  • Epsilon (ฮต): How likely should it be to find a certain person in the dataset? Epsilon can also be referred to as the “privacy guarantee” and typically has values 0.1 or 0.01. The lower the value of Epsilon (ฮต), the more noise will be applied to values, resulting in higher privacy.

Since Epsilon directly reflects the likelihood of people being identified, it should not be changed. To increase the utility of specific queries, tweaks to the sensitivity can be feasible in some situations.

For more technical information on how differential privacy is computed, you can read our technical documentation here.

Step 2 Create an anonymized view using differential privacy
+
Step 3 View the results of anonymization
+
Step 4 Run an example scenario
+
Step 5 Related topics
+
Step 6 Test yourself
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 6
1. Introduction to differential privacy 2. Create an anonymized view using differential privacy 3. View the results of anonymization 4. Run an example scenario 5. Related topics 6. Test yourself

Learn more →