Alteryx Designer Desktop Discussions

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

Comparing Two Date columns

kushalb
7 - Meteor

Hi Folks,

In My Data I have 2 columns for Date
Date format is different for both Dates
1. date of birthdate = 22-Aug-21
2. Date of upcoming birthday = 2022-08-22

I would like to check if 'Date of upcoming birthday' is exactly one year after 'date of birthdate'

 

Can anyone guide currently we need a logic as we are using a formula tool to accomplish this but needs a help

Thank you in advance

6 REPLIES 6
FilipR
11 - Bolide

FilipR_0-1663050458214.png

First you convert the dates into a proper format, then use the DateTimeDiff to see how many days there are between the two dates.

Qiu
21 - Polaris
21 - Polaris

@kushalb 
I checked the DateTimeDiff will not work for this case, since I think it gets rounded.
This is a work around.

0913-kushalb.PNG

binuacs
21 - Polaris

@kushalb One way of doing this

binuacs_0-1663050776673.png

 

grazitti_sapna
17 - Castor

@kushalb Another way is you can extract the year part of your data and then check if difference is 1. here is the workflow to achieve this.

 

Thanks!!

Sapna Gupta
Qiu
21 - Polaris
21 - Polaris

@binuacs 
The Leap Year has 366 days, ðŸ˜‚

binuacs
21 - Polaris

@Qiu I realized that later and updated the workflow to compare the dates after adding 2 to the birthday year. Thanks for letting me know ðŸ˜€

Labels
Top Solution Authors