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

Using If then string to assign codes

tpostlewate
7 - Meteor

I promise I will only have 3 or 4 more questions today...

What I am using: 
IF [New age] = "" THEN "0" ELSEIF [New age] > "44" THEN "2" ELSE "1" ENDIF

In English this is what I am trying to accomplish- If the [New age] field is blank, I either want to move a "0" to the new field [formula age] or just move the blank. Whichever is easier. If [New age] is greater than 44, move a 2 to the new field, and finally, if it is less than 44 move a 1.

 

The problem is it codes a 1 for all of the blanks. I think I understand why it is doing that, I just don't know how to fix it. It is doing great on those 2 codes, but the 1s are giving me fits.

2 REPLIES 2
Emil_Kos
17 - Castor
17 - Castor

Hi @tpostlewate,


Can you try this?

 

IF IsEmpty([New Age]) THEN "0" ELSEIF [New age] > "44" THEN "2" ELSE "1" ENDIF

 

I think this part might be problematic: [New age] = ""

tpostlewate
7 - Meteor

Brilliant! Worked perfectly! 🙂

Labels
Top Solution Authors