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.
SOLVED

if statement multiple conditions

SyP
5 - Atom

Dear All,

 

I'm trying to create the next formula :

 

Every dealer can buy tyres at any quantity,         

 

but when he has a minimum of 30 tyres he gets 6 points

but when he has a minimum of 60 tyres he gets 12 points

but when he has a minimum of 90 tyres he gets 18 points

etc….

 

How do we translate this into one formula or do you replicate the formula depending on the condition ?

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @SyP 

 

Formula would be

 

IF [no tyres]=>30 and [no tyres]<60 Then "6 points"

ElseIF [no tyres]=>60 and [no tyres]<90 Then "12 points"

ElseIF [no tyres]=>90 Then "18 points"

Else Null() Endif

 

If you provide sample data and expected output we can help you out.

 

Hope this helps : )

danilang
19 - Altair
19 - Altair

Hi @SyP 

 

If your field is called [TyresBought] then you can use the following formula

 

floor([TyresBought]/30)*6

The Floor() function returns the closest integer less than or equal to its argument

danilang_0-1628250889900.png

 

Dan

atcodedog05
22 - Nova
22 - Nova

Agreed in this usecase @danilang method makes it easy and more sense 🙂

Labels