We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Endif does not work

JustynaMZ
7 - Meteor

Hi, can anybody tell me why this formula does not work? when  I put 'ENDIF" it deactivates the end of the formula

JustynaMZ_0-1665257775145.png

 

5 REPLIES 5
hellyars
13 - Pulsar

What does the Error message state when you try to run the workflow?

Alteryx may not be processing "06" (June") as a date part.

hellyars
13 - Pulsar

@JustynaMZ 

 

Why not create a properly formatted DATE field (i.e., 2018-07-1, 2019-06-30, etc.) and use it in your IF statement.that creates a new FY field.  This would avoid dealing with date parts.

 

if [DATE] >="'2018-01-07) and [DATE] <="2019-06-30" then ..."FY19" or however you need it exactly.

 

 

 

binuacs
21 - Polaris

@JustynaMZ @Check the data type of the fields [Hire Month] and [Hire Year] to see they are string type or not? If they are numeric the. You need to remove the “ from the year and month 

apathetichell
20 - Arcturus

is it [Hire Year] or [hire year] - you have both. Alteryx is (or at least recent versions are) case sensitive and specific with field names.

danilang
19 - Altair
19 - Altair

Hi @JustynaMZ 

 

Aside from checking the field types as mentioned above, you can also replace your formula with this one

 

 

if [hire month]<="06" then
	"FY"+Right(ToString([hire year]),2)
else
	"FY"+Right(ToString([hire year]+1),2)
endif

 

 

danilang_0-1665320853359.png

Using this method, you won't have to change your workflow to make it work after July 2023.  This method will also remove the possibility of typos, like your last clause where you have year=2023 and month<=6 but year =FY24   

 

Dan

 

 

Labels
Top Solution Authors