Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

ERROR: Invalid Type in Operator <

RCern
8 - Asteroid

I am creating a new column via the Formula Tool and adding the IF Then Statement Below.   

 

If [Case Size]<'10' Then '9 & Under'
ElseIf [Case Size]>='10' and [Case Size]<'100' Then '10-99'
ElseIf [Case Size]<'200' Then '100-199'
Else '200 +'
EndIF

 

When I add the "ENDIF" condition at the end, I get an error stating the "<" in the "ElseIF[Case Size]<'200' Then '100-199' is an "Invalid Type in Operator <."   

 

Any idea as to what I am doing wrong?  It seemed pretty straight forward.  The Data Type for [Case Size] is INT32.

 

 

4 REPLIES 4
TheOC
15 - Aurora
15 - Aurora

hey @RCern 
you are stating the numbers as a string, for instance '10'. Any text or numeric within apostrophes or speech marks (' ") are defined as strings.

 

To fix your formula, remove your apostrophes from your conditions. I believe this should work:
If [Case Size]<10 Then '9 & Under'
ElseIf [Case Size]>=10 and [Case Size]<100 Then '10-99'
ElseIf [Case Size]<200 Then '100-199'
Else '200 +'
EndIF


Bulien
Raj
16 - Nebula

If [Case Size]<10 Then '9 & Under'
ElseIf [Case Size]>=10 and [Case Size]<100 Then '10-99'
ElseIf [Case Size]<200 Then '100-199'
Else '200 +'
EndIF

Raj
16 - Nebula

pfa 

Raj_0-1683202811504.png

 

RCern
8 - Asteroid

I feel like an idiot.  Staring me right in the face.   Thank you so much @TheOC !!!!!

Labels