community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Why is If Then function returning 0 when true

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

Bolide

Hi I believe what you want is

 

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

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

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

Thank you!

Labels