Alteryx Designer Desktop Discussions

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

UGH! A simple IF AND OR AND THEN TRUE ELSE FALSE formula problem

MaryCann
8 - Asteroid

Have I said I hate learning formulas?  I am positive I have.  Okay - what is wrong with this sucker?

 

IF [SERVICE ID] > "19" AND [SERVICE ID] < "26" OR [SERVICE ID] > "379" AND [SERVICE ID] < "386" THEN 'TRUE' ELSE 'FALSE' ENDIF

 

I've also tried the below, and that's wrong too!

 

IF [SERVICE ID] > "19" AND [SERVICE ID] < "26" OR IF [SERVICE ID] > "379" AND [SERVICE ID] < "386" THEN 'TRUE' ELSE 'FALSE' ENDIF

 

Side question:  Okay I need to learn this **bleeping** stuff.  I like to learn through watching Youtube and playing (trying to convince myself it's playing here, just go along with the brain trip).  Which Youtuber would you recommend I camp out to?

 

Thanks in advance!!!

3 REPLIES 3
Qiu
21 - Polaris
21 - Polaris

@MaryCann 
Please try to remove the " before and after the numbers.
"9" will make the data to be a String, then can not perform Bolean calculation.

And make sure your column "Service ID" is of Numeric.

DataNath
17 - Castor

As @Qiu says, you only need to place " around numbers when they are actually in string (text) form. When the field type is numeric, you just use the numbers themselves. Don't be so harsh on yourself - the first formula is actually perfect if you just remove the quotation marks!

 

In terms of the learning, there are great resources here on the Alteryx site itself in the form of interactive lessons, as well as the knowledge base blogs. For the formula tool/expressions specifically, see below:

 

https://community.alteryx.com/t5/Interactive-Lessons/Diving-Into-Expressions/ta-p/98817

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-Formula/ta-p/32675

 

There's also a bunch of short clips and videos put together by a lot of the great consultants/analysts you see around the forums:

 

https://www.youtube.com/results?search_query=alteryx+expressions+and+formula

MaryCann
8 - Asteroid

@DataNath !!  Thank you!  It worked!  Now, if I could just remember not to include quotes - that would help.

 

And, thanks for the video suggestions.  I've done a lot of the interactive lessons, I couldn't remember what I learned when put into the real world.  So, I've learned to reference Youtube while in the midst of the frustration.  And, although the Alteryx lessons here have video, there's often no audio.  I like audio.

 

I'm soooo glad I have this discussion/ask questions forum.  I now have a pattern that I research and try until I get frustrated (usually near the end of the day).  I do this knowing that by the time I wake up in the morning, I'll have an answer.  It is fabulous!

 

Thank you everyone, and Thank you DataNath!

Labels