Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

Replace FALSE with a blank and true with an X

Highlighted
5 - Atom

Hi all,

 

I have one input file and I am simply looking to do a replace all where in one column it says FALSE, I'd like for it to be blank or " ", and if TRUE then it says "X". I can easily do it in excel and assume I am just overlooking the method to do so in Alteryx as I must do this multiple times a day.

 

Thank you for any guidance!

Highlighted
Alteryx Certified Partner

Hi @comckinley 

 

You can use a Formula tool as follows:

 

IF [Field] = "FALSE" THEN "" ELSE "X" ENDIF

 

This assumes that all the rows have a value of FALSE or TRUE and that the field has a string type.

 

If you want to be more explicit and return a null if the field didn't contain FALSE or TRUE use the following:

 

IF [Field] = "FALSE" THEN "" ELSEIF [Field] = "TRUE" THEN "X" ELSE Null() ENDIF

 

Have a play around with the Formula tool and I'm sure you will get the hang of it.

Highlighted
16 - Nebula
16 - Nebula

@comckinley  Here are a few different options for your formula tool assuming your field is a string with either FALSE or TRUE

IF [Field] ="FALSE" Then "" Else "X" ENDIF

Replace(Replace([Field],"FALSE",""),"TRUE","X"))

 

Highlighted
5 - Atom

Thank you so much!!

Highlighted
5 - Atom

Thank you so much!

Highlighted
Alteryx Certified Partner

You're welcome!

 

By the way, single or double quotation marks are both acceptable in the Formula tool. You don't even need to be consistent, other than making sure that you open and close each particular instance with the same style.

 

I'm pleased to see that @patrick_digan is in team double-quotation marks, which is obviously the best way.

Highlighted
16 - Nebula
16 - Nebula

@jamielaird I'm very much on #TeamDoubleQuotes. It's admittedly less efficient than single quotes since I have to hit the shift key, but it's a habit that I can't break.

Highlighted
Alteryx Certified Partner

@patrick_digan it's like our own version of tabs-versus-spaces

 

https://www.youtube.com/watch?v=SsoOG6ZeyUI

Labels