We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Replace

ksarker
7 - Meteor

Hello, 

How to solve this following issue - 

 

if Column A contain 123 then 

if Column B contain XYZ then -------------

Replace Column C into "Only EXP" 

 

11 REPLIES 11
TheUdbhav
8 - Asteroid

Hi @ksarker..
Hopefully I understand your question..
You can use calculated field to replace "Only "

Column C= IF [Column A]='123' and [Column B]='XYZ' THEN 'Only_EXP' ELSE '' ENDIF

 

ksarker
7 - Meteor

something is wrong on this equation i think else and endif doesn't go together. i tried it but get error. 

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @ksarker ,

 

@TheUdbhav 's formula seems to be correct.

Column C= IF [Column A]='123' and [Column B]='XYZ' THEN 'Only_EXP' ELSE '' ENDIF

 

Please make sure you use TWO quotations between ELSE and ENDIF, not one double-quotation.

Yoshiro_Fujimori_0-1678749174877.png

For your reference, I attach the same workflow, which works on my PC.

Good luck.

ksarker
7 - Meteor

Thanks Yoshero but its didn't solve my last part of the problem. first two parts are ok then replace didn't work. if condition for column A and B are true then i want to replace entire column C into "EXP Only" and i am missing this replacement part. 

BS_THE_ANALYST
15 - Aurora
15 - Aurora

@ksarker drag a formula tool onto the canvas. In the formula tool select the column "EXP Only". 

Use @Yoshiro_Fujimori 's logic:
IF contains([Column A],'123') and contains([Column B],'XYZ') THEN [Column C] ELSE '' ENDIF

 

All the best,
BS

LinkedIN

Bulien
binuacs
21 - Polaris

@ksarker Are you looking for something like this

 

binuacs_0-1678811646413.png

 

BS_THE_ANALYST
15 - Aurora
15 - Aurora

@binuacs I think @ksarker has/wants a column called [Only EXP]. If those conditions are met, take the values from [Column C] and put them into the column [Only EXP]

 

All the best,
BS

LinkedIN

Bulien
binuacs
21 - Polaris

@BS_THE_ANALYST thank you, the requirement is confusing 😀

ksarker
7 - Meteor

My Question was if Column A = ABC then Column B= XYZ then replace anything from Column C into "EXP Only" (meaning how to update Column C for line 1 and 3 with "EXP Only")

 

Column AColumn BColumn C
ABCXYZ123
CHDGXYZ450
ABCXYZ458
Labels
Top Solution Authors