In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to use a conditional formula with multiple conditions (based on a range of values)?

cperazza
6 - Meteoroid

Hi guys,

 

This is my first week using Alteryx, and despite being an experienced Excel user (and also experienced with Knime), I'm struggling to find a way out using the Formula tool to run a conditional formula to create new values to a new column.

I have a column called [MCL] with a percentage that ranges from 0% to 100% (or 0 to 1). I have to create a new column called [MCL Band] and populate it with a string value depending on the percentage from column [MCL].

From 0 to 24.99% (or 0 to 0.2499) - 'Very Low'

From 25 to 49.99% (or 0.25 to 0.4999) - 'Low'

From 50 to 74.99% (or 0.5 to 0.7499) - 'Medium'

From 75 to 100% (or 0.75 to 1) - 'High'

 

Can anyone help me out here?
(:

 

Cheers

3 REPLIES 3
Blake
12 - Quasar

Try this expression in your formula tool while creating a new column called [MCL Band]: 

 

If [MCL] >= .75

then 'High'

elseif [MCL] >=.5

then 'Medium'

elseif [MCL] >=.25

then 'Low'

else 'Very Low'

endif

 

Good luck!

Qiu
21 - Polaris
21 - Polaris

@cperazza 
Basically same with the approach of @Blake , but I believe we should always consider exceptions.

 

1118-cperazza.PNG

cperazza
6 - Meteoroid

Thanks, @Blake

It worked!

 

@Qiu, thanks for your suggestion. Once I'm working only with a range from 0 to 1, there are no exceptions to that range. But I'll bear in mind your suggestion for other situations where I'm using a similar expression.

Cheers,

Calebe P.

Labels
Top Solution Authors