Alteryx Designer Desktop Discussions

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

Invalid Type in Operator ==

lp_hall
8 - Asteroid

Hello,

 

I realize this topic has been brought up several times before, but after reviewing all of the existing threads, I still was not able to resolve my issue. So here's my situation: I have a Formula tool that has the following code. The output column is "Office" and the data type is Double.

 

 

IF LEFT([Call Queue Code],1) = 1
THEN [Office] = "Company A"
ELSE Null()
ENDIF

 

 

Prior to this Formula tool, I have Select tool with the following data types assigned to each field:

 

lp_hall_0-1621353245158.png

 

My goal is to fill the "Office" column with "Company A" if the first character of the "Call Queue Code" field is equal to "1".

 

lp_hall_1-1621353390761.png

 

In previous posts I've reviewed, there is a consistent fix to remove quotations around the second "1" if it's not a string. As you can see, the "Call Queue Code" field is a Double and not a string, so this should work. But for whatever reason, it does not work for me. Any help would be appreciated!

 

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @lp_hall 

 

In your scenario "Call Queue Code" should be string and formula should be

 

IF LEFT([Call Queue Code],1) = "1"
THEN "Company A"
ELSE Null()
ENDIF

 

And your office column should also be a string since "Company A" is a string. You can change them both in select tool.

 

Hope this helps 🙂

atcodedog05
22 - Nova
22 - Nova

Hi @lp_hall 

 

Here is a sample workflow:

atcodedog05_0-1621354225796.png

Formula

IF LEFT([Call Queue Code],1) = "1"
THEN "Company A"
ELSE Null()
ENDIF

 

Hope this helps 🙂

lp_hall
8 - Asteroid

Thank you @atcodedog05!

 

You solved it! Also, the workflow helped resolve another issue I was having. There was no need to include the field [Office] on the THEN statement because the output is going to the [Office] column anyway.

 

Appreciate the help!

Labels