Alteryx Designer Desktop Discussions

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

Replace

ksarker
Meteoro

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 RESPOSTAS 11
TheUdbhav
Asteroide

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
Meteoro

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

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
Meteoro

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
Magnetar

@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

 

binuacs
Arcturus

@ksarker Are you looking for something like this

 

binuacs_0-1678811646413.png

 

BS_THE_ANALYST
Magnetar

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

 

binuacs
Arcturus

@BS_THE_ANALYST thank you, the requirement is confusing 😀

ksarker
Meteoro

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
Rótulos