Skip to main content
Skip table of contents

Mask names conditionally (Scramble)

In some occasions you want to apply a masking function only on a specific part of the rows within your table. Within DATPROF Privacy you can add a condition to a function to only mask specific rows that meets the condition.

In the Gasware Database there are two types of customers, the largest group are Civilians and the second group are Military personal. 

We will use the Scramble function to mask all name fields of the military customers within the Gasware Database. The scramble function replaces all alphanumeric characters (A-Z) with an 'X' and for numeric datatypes all numbers with an '1'. All special characters are staying intact and also the casing of the values will stay the same. 

Conditions are SQL snippets that will be added to the generated query. All conditions must start with the SQL WHERE clause. This condition must be valid SQL specific for the database you are developing for. To validate a condition, click the Test button in the condition editor to count the amount and the percentage of the affected rows. 

Scramble Results

OriginalMasked
John EdwardsXxxx Xxxxxxx
Chris@Evans.comXxxx@Xxxx.xxx
393.293111.111


Now lets add a conditional Scramble function

  • Select the CUSTOMER table (if not selected already)
  • Select all name columns (FIRST_NAME, LAST_NAME, LAST_NAME_UPPER, PARTNER_NAME and FULL_LAST_NAME)
  • Right click the selection and click Add function → Scramble...

The function editor will open. All the name columns are already checked. If you have missed one, you can always add them from here. Now lets the condition to this function. 

  • Click the Condition tab next to the current tab General 
  • Enter the following condition in the editor

    where TYPE = 'Military'

  • Click the Test button to validate how many rows will be affected

  • Click the OK button to add the function and close the function editor

Great! You've configured your first conditional function. 

If you're got stuck, you can also watch this short video to show you how it is done. Make the video fullscreen to get a better view. 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.