Alteryx Designer Desktop Discussions

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

How to write IF Formula

Hongli1216
8 - Asteroid

Hi, I'm trying to write an IF formula for the below file: if column [Sep & Con] is Sep, then keep the numbers in column [State Apportionment %:]; if [Sep & Con] is Con, then make the numbers zero in column [State Apportionment %:] , except 1091 in column [CoCd]. I mean I want to keep all of the numbers in column [State Apportionment %:] for CoCd is 1091 no matte it's Sep or Con. I really appreciate your great help and your time! Thanks! Holly

 

JurisdictionTax YearSep & ConState Apportionment %:CoCd
Alabama2019Sep0.0014981000
Alabama2019Sep0.0014981091
Alaska2019Con0.0000771000
Alaska2019Con0.0000771091
Arizona2019Con0.0020221000
Arizona2019Con0.0020221091
5 REPLIES 5
jeff_reynolds
10 - Fireball

See if the attached workflow does what you're looking for. I basically split the problem in 2 pieces. Rows that we know we don't want to change, and those that may change. It could all be done in one formula, but this seems easier to me. Good luck. 

markcurry
12 - Quasar

I think this might be what you're after....

 

IF [CoCd] = 1091 THEN
[State Apportionment %]
ELSEIF [Sep & Con] = "Con" THEN
0
ELSE
[State Apportionment %]
ENDIF

jacob_kahn
12 - Quasar

Check out this feed here and here 

 

good luck 

 

J

Hongli1216
8 - Asteroid

Hi Jeff,

 

Thanks for your quick help! It works. I combined yours and others and got the below formula: IF [CoCd]="1091" THEN [State Apportionment %:] ELSEIF [Sep & Con] ="Con" THEN 0 ELSE [State Apportionment %:] ENDIF. Appreciated your time! 

 

Holly

Hongli1216
8 - Asteroid

Hi Mark,

 

I really appreciated your timely help! The formula is really amazing! Thanks! 

 

Holly

Labels