Alteryx Designer Desktop Discussions

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

Multi confition if fuction

DavidOliverChapman
7 - Meteor

Hi community,

 

I am putting together a formula to add some categories to some data. 

 

I have a dataset containing the price in $ of some transactions. If the value is over, between or under certain values, then a category is returned.

 

I am using the below, and I am getting "Invalid type in operator <" 

 

if [US m adj] > 500 THEN "Over 500"
elseif [US m adj] < 500 && [US m adj] > 100 THEN "100-500"

elseif [US m adj] < 100 && [US m adj] > 50 THEN "50-100"
elseif [US m adj] < 50 && [US m adj] >10 THEN "10-50"
else "less than 10"
ENDIF

 

Any suggestions on how I am getting this wrong? 

 

Best

 

DoC

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @DavidOliverChapman 

 

"I have a dataset containing the price in $ of some transactions"

 

This probably means your numbers are in a String format. You should convert to Double or Fixed Decimal type and get rid of the dollar sign before doing number comparisons.

 

Cheers,

DavidOliverChapman
7 - Meteor

@Thableaus

 

Brilliant. First rate solution.

 

 

Labels