Alteryx Designer Desktop Discussions

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

invalid type in operator ==

Raj_007
8 - Asteroid


Hi,

I have this IF condition statement - for some reason I am getting the Invalid type in operator ==

The field in the database is int and it can have null values

[PolicyResult policyID] - This is int in database and can have null values.. so I tried to use ToString

My output column is String type - still getting this invalid type operator==could someone please help where I am go

 

IF ToString([PolicyResult policyID])="10102" OR ToString([PolicyResult policyID])="10103" OR ToString([PolicyResult policyID])="10104" THEN "Uptime"
ELSEIF IsNull([PolicyResult policyID]) OR Length(ToString([PolicyResult policyID]))="0" THEN "No Policy ID"
ELSEIF ToString([PolicyResult policyID]) IN (
"10019",
"10247",
"10248",
"10249",
"10250",
"10251",
"10262",
"10264",
"10265",
"10266",
"10284",
"10286",
"10287"
) AND Uppercase([PolicyResult Status])="BREAK" THEN "Other"
ELSE "Policy ID not in the list"
ENDIF

5 REPLIES 5
AngelosPachis
16 - Nebula

Hi @Raj_007 ,

 

I think the error comes from the quotation marks around 0

 

Screenshot 2020-12-10 213347.jpg

 

Length function will return you a numeric value, and you are comparing it with a string.

 

It should be 

 

OR Length(ToString([PolicyResult policyID]))=0

instead.

 

Give this a try and let me know if that resolved the error.

 

Cheers,

 

Angelos

Qiu
21 - Polaris
21 - Polaris

@Raj_007 

Same conclusion with @AngelosPachis after testing,

The Length function will produce a number, can not be compared with a  String.

123Capture.PNG

Raj_007
8 - Asteroid

Thank you Qiu, This is really helpful

Raj_007
8 - Asteroid

Thank you AnelosPachis - This is really helpful - it worked

Qiu
21 - Polaris
21 - Polaris

@Raj_007 
Thank you so much for the accept mark.

Just a warm note, multiple accept is allowed here, so you may consider also mark @AngelosPachis answer as accept also?

Labels