Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

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
AndrewDMerrill
13 - Pulsar

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