Alteryx Designer Desktop Discussions

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

Date Calculation

dshaw
8 - Asteroid

I want to calculate the Dates.  I have a column that is in the DateTime format.  I want to create a new column that shows me the number of years old a building is from the start date until present (i,e, today's date).  For example, I want to take 2006-10-28 and figure out how old building is today 2016-10-28.   What's the best approach?

 

Thanks,

Derreck

2 REPLIES 2
RodL
Alteryx Alumni (Retired)

Just use a formula tool with the following expression...

 

DateTimeDiff(DateTimeToday(),[DateOpened],'years')

 

Note that this will "truncate" any decimal of the years, so if you want a better result, you might want to use "days" instead of "years" as the return parameter and then divide by 365.

 

dshaw
8 - Asteroid

Perfect,  here is my final formula:

 

DateTimeDiff(DateTimeToday(),[Right_PARTICIPATION_DATE],'days')/365

 

I appreciate the tip and help.

Labels