Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Add a date from a Year value

Acoury
5 - Atom

Hello, this is a simple exercise in Excel, but I can't get it to work in Alteryx. Here is what I would like to do:

 

1) Take a Model Year field and subtract by 1 (MY= 2016 becomes 2015)

2) Take the MY-1 and set that to the Year and add August 1 as the Month Day (Output is = 8/1/ [MY-1])

3) Subtract a date in another field from the output (8/1/2019- Output(8/1/2015)= 365)/365= 1

 

So the output gives the difference between the values as Age in years to 2 decimal places

 

The equivalent in Excel is like this:

 

=ROUND((Date 1-("8/1/"&Model Year-1))/365,2)

 

Thanks!

2 REPLIES 2
patrick_digan
17 - Castor
17 - Castor

I think this formula will replicate your excel formula:

Round(DateTimeDiff([Date 1],tostring([Model Year] -1)+"-08-01","days")/365,.01)

 

Acoury
5 - Atom

That seems to have done the trick! 

 

Thanks!

Labels
Top Solution Authors