Using Conditional Masking

To demonstrate how conditional masking can handle duplicate values, add to Table 19-4 another job category, assistant (A), where the employee in this category, George, earns the same as Frank. Assume the following conditions:

  • If job category is M, replace salary with a random number between 1 and 10.

  • If job category is W, set salary to a fixed number (01).

  • Default is to preserve the existing value.

Applying these conditions results in the masked values shown in Table 19-5:

Table 19-5 Using Job Category for Group Shuffle

Employee Job Category Salary Conditional Result

Alice

M

90

5

Bill

M

88

7

Carol

W

72

01

Denise

W

57

01

Eddie

W

70

01

Frank

W

45

01

George

A

45

45

Conditional masking works when there are duplicate values provided there are no dependent columns or foreign keys. If either of these is present, a "bleeding condition" results in the first of two duplicate values becoming the value of the second. So, in the example, George's salary is not preserved, but becomes 01.