Alteryx Designer

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

INVALID TYPE in OPERATOR

Highlighted
5 - Atom

Hi,

I'm trying to create a simple condition: IF [Total FV]>0 THEN "REC" ELSE "PAY" ENDIF

But I keep on receiving INVALID TYPE in OPERATOR.....there's a problem with > operator

I tried to put "" before/after "[Total FV]>0"....then the error message disappeared but the results were rubbish as Total FV was assigned only "PAY".

 

Thanks for any advice.

 

 
 
 
Highlighted
12 - Quasar

Hi @peter987 ,

Add a select  before formula  or  check metadata  for  [Total FV]  data type .

The error  may be because  [Total FV]  is  not numeric. 

 

Highlighted
5 - Atom

Thanks,Benakesh

the thing is that Total FV is numeric...just wanna make simple condition if Total FV (fair value) is > 0 then it is REC (receivable) if not it is PAY (Payable)

I checked that data format of Total FV is V_WString so it should be set as numeric.

Thanks a lot.

Highlighted
5 - Atom

sorry, I just found there should be "" before/after 0....now it works perfectly:)

 

IF [Total FV]>"0" THEN "REC" ELSE "PAY" ENDIF

Highlighted
11 - Bolide
11 - Bolide

Hi @peter987 

 

Your formula is legit, but it may be because the field you're creating isn't a string field, but you're trying to write and output such as "PAY". Assuming you're creating a new field, you'll want to make sure it is a string to allow that kind of result, such as this (note the highlighted part):

FV.PNG

 

 

Hope that helps

 

thanks

 

Andy 

Highlighted
11 - Bolide
11 - Bolide

@peter987 wrote:

sorry, I just found there should be "" before/after 0....now it works perfectly:)

 

IF [Total FV]>"0" THEN "REC" ELSE "PAY" ENDIF


That implies that the Total FV field is not numeric; it's probably worth making sure it's numeric if you're wanting to use > or < functions, to ensure you always get the results you expect downstream! 

Highlighted
5 - Atom

Thank you ever so, Andy!

Hope this helps other users too cause I couldn't get the hang of it for ages:)

Highlighted
11 - Bolide
11 - Bolide

No problem  

Labels