Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Masking all characters of a Field while keeping the word length

Morven
6 - Meteoroid

Hi all,

 

I would like to replace all characters of a Field while keeping the word length

 

eg. I LOVE BALI ISLAND becomes X XXXX XXXX XXXXXX

or Alteryx is fun becomes XXXXXXX XX XXX

 

This is for data for an entire column and im wondering how to do it?

6 REPLIES 6
binuacs
20 - Arcturus

@Morven Something like this?

REGEX_Replace([Word], '[A-Za-z]', 'X')

binuacs_0-1682492288849.png

 

Morven
6 - Meteoroid

Yep! But if now instead of like a simple one that masks all values, I would like to mask it in a way such that if the word has one letter, it is unmasked, 2 and 3 letters and it shows the first letter, 4 letters and 5 letters it shows 2, 6 letters and more then it shows the first 4 letters only,

ie. THIS IS MY FAVORITE HOUSE -> THXX IX MX FAVOXXXX HOXXX

anandakrishnan
7 - Meteor

@Morven 

Please check the below solution

1.PNG2.PNG3.PNG4.PNG

anandakrishnan
7 - Meteor

@Morven 

In this case you can count the length and apply the formula.

Using If condition.

Morven
6 - Meteoroid

How do you do that? Sorry I'm a little new to alteryx

Christina_H
14 - Magnetar

There might be a better way to do it, but this works.  The number of characters unmasked doesn't quite match what you asked for.

Christina_H_0-1682497536750.png

 

Labels