Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Problem with my IF statement - Ends up overwriting existing values

himam
6 - Meteoroid

Hey guys, I am running an IF statement using Formula step and it is overwriting existing values. Basically I have a table that looks like the following

 

PTR LOB Seg_1

PTR LOB Seg_2Segment2
PLChk Pol 
PLRunoff 
PLRO 
LandATA
BuildingABA

 

my desired result is what you see in the table below and I am using the formula

 

DESIRED RESULT

PTR LOB Seg_1

PTR LOB Seg_2Segment2
PLChk PolExclude
PLRunoffExclude
PLRO 
LandATA
BuildingABA

 

FORMULA USED

himam_0-1674173329844.png

Instead I end up getting the following table, as you can see it ends up overwriting .

PTR LOB Seg_1

PTR LOB Seg_2Segment2
PLChk PolExclude
PLRunoffExclude
PLROExclude
LandATExclude
BuildingABExclude

Can you please advise me on what I need to fix? Thanks in advance!

3 REPLIES 3
ShankerV
17 - Castor

Hi @himam 

 

Please find the expected output.

 

ShankerV_0-1674174143931.png

 

Note: The workflow used to achieve the solution is attached which can be downloaded to see how the solution works.

 

If you believe your problem has been resolved. Please mark helpful answers as a solution so that future users with the same problem can find them more easily!!!!

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

Hi @himam 

 

Amended Formula:

ShankerV_0-1674174379883.png

 

Many thanks

Shanker V

binuacs
21 - Polaris

@himam another way of doing this with the IIF statement and IN operator

IIF([PTR LOB Seg_1] = 'PL' AND [PTR LOB Seg_2] IN ('Chk Pol','Runoff'),'Exclude',[Segment2])

binuacs_0-1674201791270.png

 

Labels
Top Solution Authors