Alteryx Designer Desktop Discussions

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

How to calculate Date

SagarGite
7 - Meteor

Hi ,

I have dates in text string in dd/mm/yyyy

I am looking to have one day less than provided date in new column

 

InputExpected Result
05/02/202004/02/2020
09/01/202008/01/2020
4 REPLIES 4
Kenda
16 - Nebula
16 - Nebula

Hey @SagarGite 

 

I would recommend using a Formula tool to create your Expected Result field with this expression: 

DateTimeFormat(DateTimeAdd(DateTimeParse([Input],"%d/%m/%Y"),-1,"day"),"%d/%m/%Y")

 

Starting from the inside and working out, this is

1. Taking your input, turning it into the date format that Alteryx can use 

2. Subtracting one day

3. Converting the date format back into a string for your output

 

Hope this helps!

mceleavey
17 - Castor
17 - Castor

Hi @SagarGite ,

 

You will need to convert the date field to a date, you can use the date parse tool for that. Then create a new formula using the following:

 

datetimeadd(<date>,-1,"Days")

 

M.



Bulien

JustinBabbitt
Alteryx
Alteryx

Hello

 

I would start by using the DateTime tool to convert the String to a Date type format. I would then use a formula to modify the date to subtract a day. 

 

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

 

 

More Info can be found here: https://help.alteryx.com/current/designer/datetime-functions

DateTime Tool: https://help.alteryx.com/current/designer/datetime-tool

Justin Babbitt
meehirm1
5 - Atom

hey @SagarGite , this should help.

Labels