Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Conditional replacement of text

louyang
7 - Meteor

Hi there,

 

I'm trying to replace text in Column C, if Column A and Column B met the conditions, if don't meet the condition, then Column C stays the same, so my formula is as below but not working:

 

if contains([Column A],'xx' and [Column B],'yyy')
THEN Replace([Column C], 'aaaa cost', 'bbbb cost')
ELSE ([Column C])
ENDIF

 

Could someone please let me know what was wrong I got here?

The formula turns to black colour, when I typed ELSE part.

Thank you.

 

Lindsay

2 REPLIES 2
geraldo
13 - Pulsar

@louyang

 

Formula:}
}

if contains([Column A],'xx') and contains([Column B],'yyy')
THEN Replace([Column C], 'aaaa cost', 'bbbb cost')
ELSE ([Column C])
ENDIF

 

louyang
7 - Meteor

Thank you so much geraldo, it works!

Labels
Top Solution Authors