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

General Discussions

Discuss any topics that are not product-specific here.
SOLVED

IF formula and data range

miki2024
6 - Meteoroid

Hello,

 

I'm trying to categorize the number of students into three buckets based on their eye sight.

S = from > 10 to 20

M = from >20 to 30

L= from >50

 

IF [Count of students]>10 THEN "S"
ELSEIF [Count of students]>20 THEN "M"
ELSEIF [Count of students]>50 THEN "L"
ELSE "N/A" ENDIF

 

When I run the results, I cannot capture the M and L using the above formula. Wonder if I miss anything?

1 REPLY 1
DataNath
17 - Castor
17 - Castor

Hey @miki2024, if you reverse your conditions then that should help i.e. have the >50 first, then >20 and then finally >10. Also, not sure if it's a typo but your current 'M' condition will cover 20-50, not 20-30 as you stated at first.

 

IF [Count of students]>50 THEN "L"
ELSEIF [Count of students]>20 THEN "M"
ELSEIF [Count of students]>10 THEN "S"
ELSE "N/A" ENDIF
Labels
Top Solution Authors