Looking for Starter Kits? Head to the Community Gallery! Now formatted as YXIs for easy installation.

Alteryx Designer Desktop Discussions

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

Finding the Last Day of the Previous Month

BrandonS4
8 - Asteroid

Hello all!  I am trying to find the correct formula to find the last day of the previous month.  I am running a report that will calculate DSO and I need to multiply by the number of days in the previous month.  Any help would be appreciated!

 

Thanks!

11 REPLIES 11
KLAMB
6 - Meteoroid

How could this be modified to pull first day of prior month (ie, 2021-07-01).

BrandonS4
8 - Asteroid

Previous Month = DateTimeAdd([OriginalDate],-1,"month")

FirstOfPreviousMonth = DateTimeAdd([Previous Month], 1-DateTimeDay([Previous Month]), "days")

LastOfPreviousMonth = DateTimeAdd([OriginalDate], 0-DateTimeDay([OriginalDate]), "days")

Labels