Start Free Trial

Alteryx Designer Desktop Discussions

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

Need help in formula

Mohini79
7 - Meteor

Hi,

 

Please let me know what is wrong in below formula

 

IF [P_PRODUCT_ID] IN ("1805","1802") THEN "Y" ELSE "N" ENDIF

 

Thanks in advance

4 REPLIES 4
martinding
13 - Pulsar

Hi @Mohini79 ,

 

What is the error message you are getting?

danilang
19 - Altair
19 - Altair

Hi @Mohini79 

 

Check the field type of the [P_Product_ID].  If it's a numeric field, remove the quotes from your In clause [P_PRODUCT_ID] IN (1805,1802)

 

Dan

gaoa
11 - Bolide

Hi @Mohini79 agree with @danilang 

  • If [P_PRODUCT_ID] is a numeric field then formula should be: IF [P_PRODUCT_ID] IN (1805, 1802) THEN "Y" ELSE "N" ENDIF
  • If [P_PRODUCT_ID] is a string field then use datacleansing tool to remove extra spaces or trim unwanted characters in the field.
StellaBon
11 - Bolide

Agree with the other commenters, and I would add that if you are creating a new field, make sure the type and size matches your desired output. You could create a Bool field to get a non-string yes or no result. 

Labels
Top Solution Authors