Alteryx Designer Desktop Discussions

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

IF statement using date logic

bakerd90
5 - Atom

Hi All. I'm trying to create a formula in Alteryx that looks at a column and if the date in that column is later than the date in a column i created then it should return the comment i add

the column i created has this,

 

datetimeadd(DateTimeAdd([1st of month],1,"months"),-1,"minutes")

 

This is correctly giving me the end of the current month.

However my new formula is not working and i think it may be due to the way the date creation formula is displaying the date

the formula i have for my if statement is,

 

if [First Day of Leave]<[Start of current choices year] then "start date in previous year" else "start date not in previous year" endif

 

Any help is appreciated :)

1 REPLY 1
JosephSerpis
17 - Castor
17 - Castor

Hi @bakerd90 there is a simpler way to find the last date of the month using the DateTimeTrim formula with the parameter of "LastofMonth" it saves all the nesting in the formula with the DateTimeAdd formulas.

 

Datetimetrim_09102023.JPG

 

 

DateTimeTrim(DateTimeNow(),"lastofmonth")

 

 

This formula would give the last date of the current month being the 2023-10-31.

Labels