Alteryx Designer Desktop Discussions

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

Masking the text

Ekta
8 - Asteroid

Dear All, 

 

 Please help me with the formula to mask the text.

 

Below is the sample input and required sample output

Input                   Output
A1234567X       Axxxx567X

 

Thank you in advance

4 REPLIES 4
AngelosPachis
16 - Nebula

Hi @Ekta ,

 

Do all the records have the same length (the given example has a length of 9 characters) and do you want to replace characters 2-5 with x in all strings?

 

If yes, the following formula will get the job done

 

Replace([Field1],
Substring([Field1],1,4),"xxxx")

 

AngelosPachis_0-1610521497773.png

 

Hope that helps,

 

Angelos

Qiu
20 - Arcturus
20 - Arcturus

@Ekta 
It will better you could provide more sample data.

0113-Ekta.PNG

Emil_Kos
17 - Castor
17 - Castor

Hi,

 

This is my formula:

 

Left([Input], 1)+'xxxx'+Right([Input], 4)

 

 

AngelosPachis
16 - Nebula

@Ekta 

 

Another solution would be to go and check if the field you want to mask has the format of an uppercase letter, followed by some digits and closing with an uppercase letter. If that's the case then you want to replace the 4 digits after the first uppercase character, else throw an error message.

 

AngelosPachis_0-1610522014187.png

A lot of different ways to go about it, it largely depends on your use case here.

 

Regards,

 

Angelos

Labels