ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

if then else to create new column

hash9
メテオール

My input data is

 

PositionLength
231
242

 

I want to create another column which should be

PositionLengthColumn
231 
24225

 

if the length is "2", then it has to take this column "Position" and add 1. If it is 1, then leave it blank

 

I tried using if the clause, but i'm getting an error(Type mismatch in operator "+")

IF [length] = "2" THEN [position] + "1"
ELSE Null()
ENDIF

 

Can someone pls help me fix this?

 

Thanks!

 

3件の返信3
MarqueeCrew
20 - Arcturus
20 - Arcturus

Did you try...

 

IF [length] = 2 THEN [position] + 1
ELSE Null()
ENDIF
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
WillTravelForData
アステロイド

I used the formula

 

IF [Length]=2 THEN [Position]+1 ELSE Null() ENDIF

 

in the attached workflow to populate the new column.hash9.PNG

hash9
メテオール

I tried and it worked. Thanks a lot

ラベル
トップのソリューション投稿者