Alteryx Designer Cloud Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Cloud.
SOLVED

How to calculate a date of previous month from a date column ? (subtract 1 month of the original date)

Marc-LEVIN
8 - Asteroid

Hi,

 

I've a date column like this :

Column 1

2019-01-15

2019-02-10

2020-09-20

 

and i want to create column to calculate the date of the previous month (subtract 1 month of the original date)

=> i want to create a column 2 like this :

Column 1 Column 2

2019-01-15 2018-12-15

2019-02-10 2019-01-10

2020-09-20 2020-08-20

 

Is it possible ?

I don't find a function to do this...

 

Thanks for your answers.

 

Regards

2 REPLIES 2
Trifacta_Alumni
Alteryx Alumni (Retired)

Hi Marc :)

 

You can just use the DATEADD function and subtract 1 month : DATEADD(your date, -1, month)

 

 

Victor

Marc-LEVIN
8 - Asteroid

Hi Victor :-)

 

OK !

Easy :-)

 

Thanks.