What are the challenges you face when working across database platforms? Take the survey

I have a database unique constraint on telephone+Email in my table and I need to replace both

What rule or setting can I put in place to ensure that my masked results are unique


  • Options
    Hi @Dredger thank you for the post!

    Whilst there is no option to select Unique Values Only for either the telephone number or email addresses (invalid) sets, I would tackle this particular problem by masking the telephone numbers as normal and then creating email addresses that are so unlikely to generate the same value that it is statistically impossible. The way I would do this is by masking Email address with a Row-Internal sync rule with the replacement value clause of "First_Name + '.' + Last_Name + DMSPARAM1 + '@' + DMSPARAM2 + DMSPARAM3"

    I've assumed that First and Last names are available on the same table so they retain some realism, if they do not you can use additional parameters to do this instead.
    For DMSPARAM1 i would set it to be Numbers, Integer (Random) from 1 to 99, DMSPARAM2 can be Text, Random Dictionary Words and then DMSPARAM3 can be some random second level domains, which you could create your own dataset for (.example.com, .invalid, .test etc.)
    This means that even though you may feasibly end up with a couple of duplicate phone numbers, the email address will always be something like chris.unwin99@happiness.example.com, the chances of generating that same value again are astronomical.

    There is potentially 1 other way around this, which is potentially generating a long list of distinct phone numbers and email addresses as custom user defined datasets, then you would be able to select these and choose the unique values only option, but you would need to have enough distinct values in those sets.

    I hope this helps! Let me know if I've mentioned anything that's not clear. 
Sign In or Register to comment.