How To: Maintain input data format when masking

How To: Maintain input data format when masking




If you have to mask a column “Record number” that has alphanumeric value. Length and format is not consistent. I need to mask each character with equivalent character i.e. alphabet with an alphabet and number with a number.

For example:

Record NumberMasked Record Number
1234AS567G9876GH234K
11W22E33FDSFG99R12Q76HUNRM

One way to achieve this would be to use the key masking technique twice. Create two key masking rules – one to mask only characters and another one to mask only digits. Next, create an advanced rule with one input column. Then, create a variable column and pass the input to the first key masking rule and configure it to mask only the numbers in source string characters using only numbers in the result string replacement characters. Pass the output of this to another key masking rule with but this time mask only alphabets using only alphabets.