Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Compare data 2 columns

JDong
8 - Asteroid

Hi Team,

 

 

I have 2 data columns and sample as below

 

AB
216.00335.80
208.30156.90
0.00127.60
0.000.00
0.00219.00
56.2679.00
0.00228.00
0.000.00
0.00165.10
0.0072.00
0.00118.00
0.0077.00
0.000.00
0.00172.50
0.00156.00

 

 

I want to write a logic like below

 

IF !isnull([A]) THEN 'CatA'
ELSEIF !isnull([B]) THEN 'CatB'
ELSEIF !isnull([CatA]) and !isnull([CatB]) THEN 'Both'
ELSE '-'
ENDIF

 

But I do not see the right results considering the above formula. I want to if value only in "A" call in a new field CatA and if value only in "B" then CatB and if value in both columns then as "Both"

 

Thanks!

1 REPLY 1
geraldo
13 - Pulsar

@JDong 

 

IF !isnull([CatA]) and !isnull([CatB]) THEN 'Both'

elseif !isnull([A]) THEN 'CatA'
ELSEIF !isnull([B]) THEN 'CatB'
ELSE '-'
ENDIF

Labels