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.
SOLVED

Formula not working as V_String or Double

adamhill3
7 - Meteor

I am trying to create a new column to return an "N" if there is a 0 in the column and a "Y" if there is any other value.

 

I am trying to write an IF statement to do this, however, I keep coming up against the error message "An operator must be between operands". This is the formula I was trying:

 

IF ([RegEx1]= "0" THEN "N" ELSEIF ([RegEx1] THEN "Y" ENDIF

 

IF ([RegEx2]= "0" THEN "N" ELSEIF ([RegEx2] THEN "Y" ENDIF

 

I am struggling to understand how to resolve this. I was looking around the community and have tried changing the data type between V_String and Double but neither way is working. 

 

I have attached some sample data which shows the data in the columns and the desired outcome. Any help would be much appreciated 

4 REPLIES 4
RishiK
Alteryx
Alteryx

Hi there

 

You need to use a simple IF ELSE Block I think. Have a look at the attached workflow.

 

I have created 2 columns as RK Output1 and RK Output2

 

adamhill3
7 - Meteor

@RishiK wrote:

Hi there

 

You need to use a simple IF ELSE Block I think. Have a look at the attached workflow.

 

I have created 2 columns as RK Output1 and RK Output2

 


Thank you, but I cannot open a packaged workbook as I am in an older version of Alteryx and unable to update.

Could you by any chance attach a non-packaged version or just paste the code?

RishiK
Alteryx
Alteryx

I've attached the unpackaged version. Here is the code for both columns also:

 

IF [RegEx1] = 0 THEN "N" ELSE "Y" ENDIF

 

IF [RegEx2] = 0 THEN "N" ELSE "Y" ENDIF

adamhill3
7 - Meteor

@RishiK wrote:

I've attached the unpackaged version. Here is the code for both columns also:

 

IF [RegEx1] = 0 THEN "N" ELSE "Y" ENDIF

 

IF [RegEx2] = 0 THEN "N" ELSE "Y" ENDIF


Thanks so much, this is perfect

Labels
Top Solution Authors