Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
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
7 - Meteor

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