Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

I am not getting the intended results from the contain phrase.

lynettejackson
7 - Meteor

My expression is not working can someone please explain what I am doing wrong.

if Contains([Building], "15") then "15"
Elseif contains ([Building], "48A") then "48A"
Elseif contains ([Building], "48B") then "48B"
Elseif contains ([Building], "48C") then "48C"
Elseif contains ([Building], "77") then "77"
Elseif contains ([Building], "87") then "87"
Elseif contains ([Building], "88") then "88"
Elseif contains ([Building], "98A") then "98A"
Elseif contains ([Building], "98B") then "98B"
ELSE 'Invalid'
ENDIF

4 REPLIES 4
Luke_C
17 - Castor
17 - Castor

I don't see anything wrong with the syntax. Can you share some sample data that demonstrates the issue?

SusieF
7 - Meteor

Your expression syntax is fine ...unless you are trying to create a new column and trying to assign an incorrect datatype?

lynettejackson
7 - Meteor

Hi Luke,

 

Thank you for confirming the expression is correct.  I reran the WF and I received no new error.

Emmanuel_G
13 - Pulsar

Hi @lynettejackson ,

 

The if syntax is correct.

 

Two possible hypotheses for your error message: Either You have not given the name of the column to create (it must be specified in the kind of drop-down list which is just above the word if in the capture below).

 

Either you have indicated this output column and this column is of numeric type but since the results of your condition are strings, this returns an error.

 

Do you find yourself in one of the cases?

Emmanuel_G_0-1659170966367.png

 

 

Labels
Top Solution Authors