Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

date minus a certain amount of days

ozzy78910
6 - Meteoroid

Hi all

 

I want to subtract 20 days from a date value, how is this done using a formula icon?

 

thanks

osman

3 REPLIES 3
fmvizcaino
17 - Castor
17 - Castor

Hi @ozzy78910 ,

 

That is achievable with the help of datetimeadd function.

DateTimeAdd([Date],-20,'days')

 

https://help.alteryx.com/10.1/Reference/DateTimeFunctions.htm

 

Best,

Fernando Vizcaino

MichaelLaRose
10 - Fireball

Hi Ozzy,

 

The formula you are looking for is:

 

DateTimeAdd([Date],-20,"days")

 

Best,

Michael

rupali_bhise
8 - Asteroid

Hey @ozzy78910 , 

 

You can use below mentioned formula for subtract to date time in days. 

DateTimeAdd([Date],-20,'days')

 

DateTimeAdd (<date/time>, <interval>, <units>) 

The <date/time> - datetime you want to manipulate,   

The <interval> specified the amount of time to be added, and

The <units> the date/time units to add.  The units are years, months, days, hours, minutes, or seconds (only one can be used), and the interval can be either positive or negative.

 

Good luck

Labels