Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Multiple IF And statements using ToNumber causing error

ChyristinaBrown
6 - Meteoroid

I'm trying to create tiering based on revenue (number field).  I'm having an issue with a formula, and I can't pinpoint what the problem is.  

 

IF ToNumber([MR Revenue (USD$)]<100000000) THEN "Up To 100 million"

ELSEif

ToNumber([MR Revenue (USD$)]>100000000) AND ToNumber([MR Revenue (USD$)]<500000000) then "$100 million To $500 million"

elseif

ToNumber([MR Revenue (USD$)]>500000000) AND ToNumber([MR Revenue (USD$)]<5000000000) then "$500 million To $5 billion"

elseif

ToNumber([MR Revenue (USD$)]>5000000000) AND ToNumber([MR Revenue (USD$)]<25000000000) then "$5 billion To $25 billion"

else "Unknown" ENDIF

 

The expression turns black at the bolded portion.  I can't figure out why though.  

 

Any thoughts?

2 REPLIES 2
atcodedog05
22 - Nova
22 - Nova

Hi @ChyristinaBrown 

 

You need to only pass field into ToNumber() function like below <100000000 should be outside like below.

 

IF ToNumber([MR Revenue (USD$)])<100000000 THEN "Up To 100 million"

ELSEif

ToNumber([MR Revenue (USD$)])>100000000 AND ToNumber([MR Revenue (USD$)])<500000000 then "$100 million To $500 million"

elseif

ToNumber([MR Revenue (USD$)])>500000000 AND ToNumber([MR Revenue (USD$)])<5000000000 then "$500 million To $5 billion"

elseif

ToNumber([MR Revenue (USD$)])>5000000000 AND ToNumber([MR Revenue (USD$)])<25000000000 then "$5 billion To $25 billion"

else "Unknown" ENDIF

 

Hope this helps 🙂

ChyristinaBrown
6 - Meteoroid

That works.  Thank you.  

Labels