In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

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

Prajakta29
5 - Atom

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 REPLIES 4
tim-regas
8 - Asteroid

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
16 - Nebula

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

Raj
16 - Nebula

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

Prajakta29
5 - Atom

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

Labels
Top Solution Authors