Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

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
Top Solution Authors