SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Create an Anonymized View Using K-Anonymity

Create anonymized views in SAP HANA Cloud, SAP HANA database using k-anonymity to avoid identification of individuals based on quasi-identifiers.

Overview

You will learn

  • ✔How to define your anonymization strategy
  • ✔How to define generalization hierarchies for quasi-identifiers
  • ✔How to create an anonymized view using embedded hierarchies
  • ✔How to create an anonymized view using hierarchy functions
  • ✔How to verify the results of anonymization
Hui Li H Hui Li October 14, 2026
Created on August 29, 2021
Contributors

More from Hui Li

See all 5 tutorials by Hui Li →

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

Step 1 > ### **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.

Now that you know the different approaches to data anonymization in SAP HANA Cloud, SAP HANA database you can start to implement them. In this tutorial, we will provide you with detailed step-by-step instructions how to use the method of K-Anonymity to avoid that individuals in your dataset can be re-identified based on quasi-identifiers.


Step 2 Define the anonymization strategy
+
Step 3 Define generalization hierarchies
+
Step 4 Create an anonymized view using embedded hierarchies
+
Step 5 View the results of anonymization
+
Step 6 Run an example scenario with sample data
+
Step 7 Create an anonymization view with the sample data
+
Step 8 Get to know hierarchy functions
+
Step 9 Create a hierarchy function that shortens numbers from right to left
+
Step 10 Create a hierarchy function that groups values to ranges
+
Step 11 Explore other customization options for k-anonymity
+
Step 12 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 12
1. > ### **Disclaimer** 2. Define the anonymization strategy 3. Define generalization hierarchies 4. Create an anonymized view using embedded hierarchies 5. View the results of anonymization 6. Run an example scenario with sample data 7. Create an anonymization view with the sample data 8. Get to know hierarchy functions 9. Create a hierarchy function that shortens numbers from right to left 10. Create a hierarchy function that groups values to ranges 11. Explore other customization options for k-anonymity 12. Test yourself
Next