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

Looking for Formula that looks for the first date in the previous month

Data_Driven
5 - Atom

Hi guys,

 

I don't have a workflow to share but I think this should be an easy answer for someone besides me 🙂 I have tried searching through past questions, training materials for a couple hours already.

When using the Formula tool I've figured out how to create a formula that looks for the last day in the previously month

 

Example that works: 

= DateTimeAdd(
DateTimeTrim(DateTimeToday(),'FirstOfMonth'),-1,'day')"

 

 But I'm having trouble making a formula that looks for the first day of the previous month? I'd prefer to find a solution that doesn't rely on a date if possible.

 

Example that I need help with as it doesn't work for me:

 

= DateTimeAdd(
DateTimeTrim(DateTimeToday(),'FirstOfMonth'),-1,'month')

 

Thanks in advance!

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus

@Data_Driven ,

 

DateTimeFormat(DateTimeAdd([Any Date],-1,"month"),"%Y-%m-01")

 

or ....

 

DateTimeFormat(DateTimeAdd(DateTimeStart(),-1,"month"),"%Y-%m-01")

 

cheers,

 

mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Data_Driven
5 - Atom

@

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

Lots of ways to solve and I'm thankful that you liked mine. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels