ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
RÉSOLU

IF ELSEIF Invalid Type in Operator ==

jlrouquette
Météore

I'm getting the "invalid type in operator" error for this formula. I'm not sure what isn't correct about the way it's written.  MaxProbability is being generated by a formula to pulls the max value across the five respective columns for a single row.  In a new column, I would like to generate the output from the formula below.        

 

IF [MaxProbability] = [FinalScore_E] THEN 'E'
ELSEIF [MaxProbability] = [FinalScore_D] THEN 'D'
ELSEIF [MaxProbability] = [FinalScore_C] THEN 'C'
ELSEIF [MaxProbability] = [FinalScore_B] THEN 'B'
ELSEIF [MaxProbability] = [FinalScore_A] THEN 'A'
ELSE 'ERROR'
ENDIF 

 

9 RÉPONSES 9
Inactive User
Non applicable

Nothing wrong with formula; one of those fields either the max prob or the finalscore fields is a string. You are having a data type mismatch where you are setting equals from an integer/double to a string. ToString() or ToNumber() the appropriate field and you will get the result you are after.

jlrouquette
Météore

Awesome, thank you!

JP23
Météore

Thanks, this was super helpful!

mgarcia174
Atome

I was having a similar issue and this resolved it. Thanks, super helpful!

tk123
Météoroïde

So what is the actual solution?

Marko1986
Météore

I tried your solution but it is not correct for my problem. All fields that I want to use are double, and still I have invalid type in operator error.

Problem in attachment

BenMoss
ACE Emeritus
ACE Emeritus

In your formula you need to take the = "0" out of qoutes, it should be = 0

 

Ben

Shelaj
Météoroïde

Really Helpfull...........Thanks

namans0297
Atome

Thanks, Super helpful :)

 

 

Étiquettes
Auteurs des meilleures solutions