Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula to add previous month to dataset

CDIns
8 - Asteroid

Looking for a formula that will add the 'Reporting Date' to my dataset. I always complete this task the first week of the following month. So next week during first week of august, I'll need my report to say 7/31/24. 

 

I am currently using the below formula:

 

Datetimeadd(datetimefirstofmonth(),-1,'days')

 

Its giving my the correct reporting date of 06/30/24 however, its also including the time. The time date is formatted as 2024-06-30. 

 

 

Is there anyway to remove the timestamp? and convert the format from 2024-06-30 to 06/30/24? 

 

Thanks in advance, 

 

 

1 REPLY 1
CoG
14 - Magnetar

You can do this quite simply by adding the following function:

 

DateTimeFormat(Datetimeadd(datetimefirstofmonth(),-1,'days'), "%m/%d/%Y")

 

Hope this helps and Happy Solving!

Labels
Top Solution Authors