We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Obtain age in decimals from different date columns

eleee3
8 - Asteroid

Hi all,

 

I have a dataset from which I want to extract ages from dates. An example of how my database looks is:

 

PartDate PurchaseDate InstalledDate of First UseAge at 27/02/23
Engine01/01/2000   
Gearbox 04/02/2013  
Tyre #3 13/03/2022  
Seatbelt #5  03/06/2021 

 

And I want Alteryx to calculate ages in decimals so that my output looks like this:

 

PartDate PurchaseDate InstalledDate of First UseAge at 27/02/23
Engine01/01/2000  23.15
Gearbox 04/02/2013 10.06
Tyre #3 13/03/2022 0.96
Seatbelt #5  03/06/20211.73

 

I want to do this for multiple dates - e.g., a column for age at 27/02/2023, 01/06/2023 and 10/12/2023.

 

Could someone please show me how to do this in Alteryx?


Thanks in advance!

2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @eleee3 

 

Here's an example using the datetimediff function. I found the age in days and divided by 365, so there would be some margin of error due to leap years - hopefully this give you a good idea though!

Luke_C_0-1677467582998.png

 

eleee3
8 - Asteroid

That's great, thanks so much, @Luke_C!

Labels
Top Solution Authors