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

Operations between dates with LeapYear

aniutt89
5 - Atom

Hi everyone, I know that several questions have been asked similar to this one, however, I was not able to find the thread that could help me in this regard. I have two columns with some random dates as below.

 

 

Col A Col BCol C
DD-MM-YYYYDD-MM-YYYYXXXX

 

I would like to filter only the transactions that have:

[Col A - Col B] more than a month and less than a year. This logic should take into account also the Leap years.

 

Here it is the expected output I am aiming to.

 

Col ACol BCol C
29-02-202029-03-2020less than a month
29-02-202030-03-2020more than a month and less than a year
29-02-202030-03-2020more than a month and less than a year
29-02-202028-02-2021more than a month and less than a year
30-11-201931-12-2019More than a month and less than a year

 

Thanks!

5 REPLIES 5
danilang
19 - Altair
19 - Altair

Hi @aniutt89 

 

What exactly do you mean by less "than a month"?  30 days? 31 days?  Because 2020-02-29 to 2020-03-29 is exactly 1 month according to the standard definition of same day number in the subsequent month.  The same question applies to less than a year.  2020-02-29 and 2021-02-28 are exactly one year apart.  

 

Dan

 

Dan  

aniutt89
5 - Atom

 

 

aniutt89
5 - Atom

Hi @danilang,

 

It depends on the month, if in Column A we have a month with 28/29 days (Feb in this case), 29/30 days must have passed. In case we have a month with 30 days, 31 days must have passed and so on.

 

ArtApa
Alteryx
Alteryx

@aniutt89 - Honestly, I did not understand your requirement description, but based on your sample I've built the following:

ArtApa_0-1625977405774.png

 

aniutt89
5 - Atom

Thanks @ArtApa! It worked as expected. Really appreciated!

Labels