Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Help with Formula Tool - Malformed If Statement

lisamccullough
8 - Asteroid

Hello - I'm hoping someone can help me with this formula that I'm trying to enter. I keep getting a Parse Error:

 

IF [% Total Assets]>=1
OR
IF [% Total  Assets]<=5
THEN "Y" ELSE " " ENDIF

 

It appears the "ENDIF" is the problem because it's underline in red. Not sure what I'm doing wrong. Thank you in advance for all the help you provide or have provided. I appreciate it!

6 REPLIES 6
RolandSchubert
16 - Nebula
16 - Nebula

Hi @lisamccullough ,

 

I think, only a small modification is needed:

Try:

IF [% Total Assets]>=1 OR [% Total  Assets]<=5 THEN

"Y"

ELSE

" "

ENDIF

 

Let me know if it works for you.

 

Brest,

 

Roland

 

vizAlter
12 - Quasar

@lisamccullough — not sure why you are using a space char " " in the formula.

Hope, this will be helpful:

vizAlter_0-1604319994274.png

 

lisamccullough
8 - Asteroid

I failed to mention that the %Total Asset data type is V-String. Should it be a Double? I ask because I'm still unable to get this formula to work. Or how can I change my formula to double?

atcodedog05
22 - Nova
22 - Nova

Hi @lisamccullough 

 

yes should be double. Either you can use select tool to convert [% Total Assets] to double or you use can below formula to convert during calculation itself.

 

IF ToNumber([% Total Assets])>=1 OR ToNumber([% Total  Assets])<=5 THEN "Y"
ELSE " " ENDIF

 

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

vizAlter
12 - Quasar

@lisamccullough — Take a look at below:

Now, the data type is double so you should use Null() instead of a space " " in the formula.

 

vizAlter_0-1604322459130.png

 

 

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @lisamccullough 

 

Cheers and Happy Analyzing 😀

Labels
Top Solution Authors