Alteryx Designer Discussions

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

Formula for Replacing a value in a column

6 - Meteoroid

Hi! I have data in alteryx that looks like this:

 

BrandModel

Apechete

Chare
ApecheteChare
ApecheteCrux
ApecheteChare

 

I am trying to create a formula that replaces the value "Crux" in the model column to say "Chare" if brand="Apechete. 

 

I figure you use a formula that looks something like: IF[Brand]="Apechete" and [Model]="Crux" then REPLACE ....

 

can't figure out the replace part

Alteryx Certified Partner
Alteryx Certified Partner

@aliciadavoudpour ,

 

so close. 

If [brand] = "Apechete" AND [model] = "Crux"

     THEN "Chare"

Else

[Model]
Endif

 

 use that in a formula tool and you should be good to go. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
6 - Meteoroid

Hey Mark, 

 

Type in those formula: If [brand] = "Apechete" and [model] = "Crux" then "Chare" else [model] Endif  

 

but, I am getting an error "the field "" is not contained in the record. (Expression #1)

 

updated: it worked thank you!!

Alteryx Certified Partner

Hi @aliciadavoudpour ,

 

That error is probably because you have not selected a name for the column you want to create or that name is not valid. Could you please make sure that you have filled in a name in the box just above the expression, when you are prompted to "Select a column"? 

 

Thanks,

 

Angelos

Alteryx Partner
Alteryx Partner

@aliciadavoudpour 

 

What @AngelosPachis is pointing out here is this: 

joshuaburkhow_0-1607278054181.png

You need to update this by selecting a field or creating one 🙂 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
Labels