In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Why is If Then function returning 0 when true

jasontax
7 - Meteor

The following IF THEN function is returning 0 when true instead of 13.  Anyone have ideas on the issue?

 

IF [ST]="17" and [Sale Type]="Programming" THEN [Vertex Tax Category]= "13"
else  [Vertex Tax Category] ENDIF

4 REPLIES 4
jasperlch
12 - Quasar

Hi I believe what you want is

 

IF [ST]="17" and [Sale Type]="Programming" THEN "13"
else  [Vertex Tax Category] ENDIF

clant
8 - Asteroid

You should update it to the below and have Vertex Tax Category selected in the output column on the formula window.

 

IF [ST]="17" and [Sale Type]="Programming" THEN "13"
else  [Vertex Tax Category] ENDIF

ivoller
12 - Quasar

The logic is returning 0 correctly.

 

IF [ST]="17" and [Sale Type]="Programming"// This is TRUE

THEN // TRUE Clause

         [Vertex Tax Category]= "13" // Returns 0 (FALSE) becuase [Vertex Tax Category] does not equal 13
else // FALSE Clause

         [Vertex Tax Category] ENDIF

 

If you want to set Vertex Tax Category then use this as the Output Column in formula and use something like

 

IF [ST]="17" and [Sale Type]="Programming" THEN "13" else  [Vertex Tax Category] ENDIF

 

Cheers,

Iain

jasontax
7 - Meteor

Thank you!

Labels
Top Solution Authors