ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
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