Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Formula to Find the END Date

DataPirate26
10 - Fireball

Hello, 

 

In this Workflow attached below The End Date needs to be updated as such It will be the Last day of the Next month from current date. So for example If current date is 2021-12-17 then the End Date needs to be updated as 2022-01-31. So basically the year needs to be changed dynamically. Can anyone help me to update the Formula. 

 

The workflow is attached below. 

9 REPLIES 9
AngelosPachis
16 - Nebula

Hi @DataPirate26 

 

Maybe you can try

 

Datetimetrim(
DateTimeAdd(
DateTimeTrim([Current date],"firstofmonth")
,1,"month"),
"lastofmonth")

 

What this is gonna do is take your current date field and force it to the first of that month (so 2021-12-17 will become 2021-12-01). The you will add a month to that date, so 2021-12-01 will become 2022-01-01 and finally you will trim that to the end of the month, so 2022-01-31.

 

AngelosPachis_0-1639724545704.png

 

 

Hope that helps,

Angelos

Qiu
20 - Arcturus
20 - Arcturus

@DataPirate26 
We have a function "DateTimeTrim" can be used here.

Capture51.PNG

Qiu
20 - Arcturus
20 - Arcturus

@AngelosPachis 
You are fast...😁

AngelosPachis
16 - Nebula

Thanks @Qiu  😅 I'm thinking of participating in the Grand Prix in the next Inspire conf.

 

Thank you for also helping me to realise that you probably don't need to trim it to the first of the month firstly ( I thought the formula wouldn't work for February for example)

Qiu
20 - Arcturus
20 - Arcturus

@AngelosPachis 
Wow, go for it. looking to see you in there and maybe get the champion!😁

DataPirate26
10 - Fireball

This is super awesome. Thanx got to learn something New. I hope this will work fine for all the months right ? 

Qiu
20 - Arcturus
20 - Arcturus

@DataPirate26 
Yes, it should be.
And it helps, apppreciate if if you would mark my and @AngelosPachis solution as accept. 

DataPirate26
10 - Fireball

@AngelosPachis @Qiu Thanx for a quick resolution. 

AngelosPachis
16 - Nebula

Thanks @Qiu , really appreciate it! 

Labels