Alteryx Designer Desktop Discussions

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

Replace dash value but not -ve sign values within a field

Prajakta29
Atome

Hello. I have multiple fields in a dataset that have "-" as a value which I want to replace with a blank. However any replace function I try, it also replaces the -ve sign in the column. How can I avoid this? I only want to replace the entire dash value and retain the negative values. 

Attaching is a sample dataset. This is the regex function I tried but it replaces negative values as well:

 

REGEX_Replace([_CurrentField_], "\-", " ")

4 RÉPONSES 4
tim-regas
Météore

Using sheet 2 from the dummy data, you an use a select tool to convert the strings to double type. This will drop the - values and replace them with null while retaining the negative values.

 

Replace Dash Values.png

Raj
Nébuleuse

@Prajakta29 you can use replace tool
so in case you are not only restricted to numbers this will work perfect

Raj
Nébuleuse

@Prajakta29 find workflow attached for reference
mark done if solved.

Prajakta29
Atome

I won't be able to use this as I have multiple fields >200 that need to be updated

Sondage
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Étiquettes