Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Remove all special characters/punctuations except for - and &

Idyllic_Data_Geek
8 - Asteroid

Currently I'm using data cleansing tool to remove the punctuations from a field. however the requirement is to remove everything except for hyphen – and the ampersand & symbols. How can I accomplish this? Thanks in advance for your help!

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @Idyllic_Data_Geek 

 

Try this formula

 

atcodedog05_0-1645194253391.png

 

Hope this helps : )

 

binuacs
21 - Polaris

@Idyllic_Data_Geek 

REGEX_REPLACE([Text],'[^\w\s\-&]','')

 

binuacs_0-1645195257554.png

 

Idyllic_Data_Geek
8 - Asteroid

The issue with this one is that it also truncating the valid spaces in between

atcodedog05
22 - Nova
22 - Nova

Hi @Idyllic_Data_Geek 

 

Please find the updated formula

 

atcodedog05_0-1645205895982.png

 

Hope this helps : )

 

Idyllic_Data_Geek
8 - Asteroid

Hello.

 DO you know what this formula is doing? IIF(isNull([Row-1:1]),1,[Row-1:New Column]+1)

ddiesel
13 - Pulsar
13 - Pulsar

Hi @Idyllic_Data_Geek!

 

It looks like the formula you are referencing is in a Multi-Row formula tool.

 

Translation:

If column "1" is null in the row above the current row, then the value of 1 is returned. Otherwise, "New Column" plus 1 from the row above the current row is returned. 

 

Sounds like the new column is creating a RecordID. Is it working for you? Looks odd to me.

 

If you need help with this formula, I recommend opening a new topic.

 

 

 

martinson
8 - Asteroid

Attempt 1

Labels