Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

to add last day of the month in date with month and year

Ekta
8 - Asteroid

Dear all, 

Please help me the workflow for calculating the last date of the month , if input is 

2018-03 and required output is the last 30/03/2018

Please help me with this.

Best regards

4 REPLIES 4
grazitti_sapna
17 - Castor

Hi @Ekta ,

Please find the solution below for your problem.

Thanks.

Sapna Gupta
Ekta
8 - Asteroid

Thank you so much,

how can we convert this date into the date format?

201809 2018-09-30

 

thank you in advance

MarqueeCrew
20 - Arcturus
20 - Arcturus

@Ekta ,

 

i wrote about dates once or twice. Here's an article about Dates that you might find helpful. 

 

You will need to convert the string into a date format that Alteryx understands. It will become the first of the month. Then you'll add 1 month. Next you'll subtract 1 day. Now you're working with a date that's the end of the month with the right number of days. 

 

If you want a specific format of the date, you'll need to format the date as a string. 

 

Open that hyperlink and get more help there. 

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
danilang
19 - Altair
19 - Altair

Hi @Ekta 

 

An alternative to adding a month and subtracting a day to use DateTimeTrim([DateField],"lastofmonth"). This returns a DateTime value one second before the end of the month.  If you need this converted from a DateTime to a Date use ToDate(DateTimeTrim([DateField],"lastofmonth"))

 

Dan

Labels