community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
#SANTALYTICS

Gather all 9 clues to complete the final Weekly Challenge on Dec 16!

Learn More
SOLVED

Replace FALSE with a blank and true with an X

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!

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.

@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"))

 

Thank you so much!!

Thank you so much!

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.

@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.

Alteryx Certified Partner
Labels