Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Formula error

Sa743liz-
8 - Asteroid

Hi everyone I'm trying to do this formula below but is not working, can you help me? 

Sa743liz_0-1664215394653.png

 

4 REPLIES 4
IraWatt
17 - Castor
17 - Castor

Hey @Sa743liz-,

What are you trying to achieve here? If you want to minus one date from another you can use the datetime functions like DateTimeDiff(dt1,dt2,u) which calculates the difference between two dates in days/weeks/months ect...

 

If your interested in learning more about the datetime functions there is a great cheat sheet Blog here: https://community.alteryx.com/t5/Engine-Works/DateTime-Functions-Cheat-Sheet/ba-p/844353

 

 

binuacs
21 - Polaris

@Sa743liz- as @IraWatt mentioned you need to use the datetimediff function here to calculate the days between two dates. Attaching a sample workflow for your reference

 

binuacs_0-1664216105166.png

 

Sa743liz-
8 - Asteroid

Thank you @IraWatt the DateTimeDiff works but only shows the full number per years. I will need with two decimals like this following ouput: 

Sa743liz_0-1664217144095.png

This is how it looks at the moment: see below 

Sa743liz_1-1664217196251.png

 

IraWatt
17 - Castor
17 - Castor

Aaahh thats alright @Sa743liz- just do days then divide by 365:

IraWatt_0-1664218597485.png

 

Labels