Alteryx Designer Desktop Discussions

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

I need help with an error in my workflow in my IF statement

pmolan5059
5 - Atom

I'm getting Parse Error at char(610): malformed if statement (expression#1).

 

it seems to be tied to the end if statement.  Can someone look at my formula and see what the potential issue is.

 

IF [REVENUE_MONTH]="202301"
THEN "01 January"

ELSEIF [REVENUE_MONTH]="202302"
THEN "02 February"

ELSEIF [REVENUE_MONTH]="202303"
THEN "03 March"

ELSEIF [REVENUE_MONTH]="202304"
THEN "04 April"

ELSEIF [REVENUE_MONTH]="202305"
THEN "05 May"

ELSEIF [REVENUE_MONTH]="202306"
THEN "06 June"

ELSEIF [REVENUE_MONTH]="202307"
THEN "07 July"

ELSEIF [REVENUE_MONTH]="202308"
THEN "08 August"

ELSEIF [REVENUE_MONTH]="202309"
THEN "09 September"

ELSEIF [REVENUE_MONTH]="202310"
THEN "10 October"

ELSEIF [REVENUE_MONTH]="202311"
THEN "11 November"

ELSEIF [REVENUE_MONTH]="202312"
THEN "12 December"

endif

3 REPLIES 3
Prometheus
12 - Quasar

You're just missing one component of your expression and that is your final ELSE. With a conditional expression, you need to put what occurs when none of your conditions are met. The syntax for that is as follows:

IF [MONTH]="A"

THEN 1

ELSEIF [MONTH]="B"

THEN 2

ELSE 3

ENDIF

 

You're almost there!

SPetrie
12 - Quasar

You need the final else condition to finish the formula.

Also, you may want to look into an alternative formula to get your result.

datetimeformat(DateTimeParse([date],"%Y%m"),"%m %B")

This would parse the YYYYMM format you have and output MM Month and it would not be coded to a specific year as you have in your if statement.

1.PNG

pmolan5059
5 - Atom

I tried the final condition and couldn't get it to work. Changing the formula to the datetimeformat worked. Thank you!

 

Labels