Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

"If not equal then"

BillyL14
8 - Asteroid

Hi 

I am fairly new to Alteryx and still figuring how to use a lot of the functions.

I have a dataset with several columns.  

In column A I have country codes such as AT, FR, GB, BE etc and in column B I have a code for transport method.  At the moment all the transport code are 1 for all countries but I need all codes for countries other than GB to be 3. I have tried the below formula but instead of turning the 1's into 3's, it has turned them into zeroes. Could someone let me know what I have done wrong please? I have tried both MoT ans DestC as the Output column.

 

WL1_0-1594305054184.png

 

Thanks

 

4 REPLIES 4
PedrodeOl
9 - Comet

Hello @BillyL14,

 

 

IF {Test} THEN {Value1} ELSE {Value2} ENDIF

 

 

You are passing a {Test} into the THEN, Alteryx will return 0 if the test is false and 1 if it's true. Simply insert "3" after the THEN.

 

Best Regards

 

 

JosephSerpis
17 - Castor
17 - Castor

Hi @BillyL14 if you remove [MoT]= in your formula it should work then. 

dsmdavid
11 - Bolide

Hi WL1,

You just need to remove "[MoT]=" from your formula.
What Alteryx is understanding at the moment is if DestC is not GB then test whether MoT equals 3 (which evaluates to false) and put that result here (thus the 0).

 

Hope it helps, 

David

BillyL14
8 - Asteroid

Thank you all

Labels