Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Mask data with asterisk

MarcosC_
7 - Meteor

Hi all,

 

I need to mask some client data on the output file however, searching for this topic I only get annonymzed data / incoherent text. However the goal is for the knowing people to still be able to recognize who the client might be.

 

What I want is to keep the first letter of the cell followed by 3 asterisks.

 

So as an example, the cell would be John Smith, Ltd and after the formula the cell should be just J*** for example.

Any ideas on how can I do that?

 

Thanks,

Marcos

4 REPLIES 4
binuacs
21 - Polaris

@MarcosC_ use regex_replace() formula

image.png

Pilsner
12 - Quasar

Hello @MarcosC_ 

I may have gone a bit over the top, but if you need the number * to match the number of characters, then you can do the following. 

1) Separate the first character and the remaining characters into separate cells. 

2) Replace all characters in the "remaining" column with *.

 

3) Append the first character back to the start. The solution looks something like this: 

Screenshot 2025-05-27 192244.png



I've attached the workflow below. 

Please let me know how you get on.

Regards - Pilsner

MarcosC_
7 - Meteor

Thank you both @Pilsner and @binuacs .

I had to incorporate both solutions in the end.

The client name field had many with spaces and dots in the middle so the first solution captured most of them but still had for example "J*** . Company LTD"

 

So the 2nd solution puts all the *** no matter the string length and then I just trim it down afterwards to reading the output and formatting with just three asterisks.

 

Thanks both.

Pilsner
12 - Quasar

Glad I could help. Thanks for sharing your final solution too!

Labels
Top Solution Authors