Calling all Racers for the Alteryx Grand Prix! It's time to rev your engines and race to the stage at Inspire! Sign up here.

Alteryx Designer Discussions

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

Middle day of 2 dates

ankitsingh2063
8 - Asteroid

Hello,

 

I have 2 columns with dates (Previous Date and Next Date). There is always a gap of 14 to 15 days between these 2 dates

 

I need to find the middle date between these 2 dates - ensuring that month change between these 2 dates does not skew my output

2 REPLIES 2
kcgreen
8 - Asteroid

If your dates are in a Date format already, you can get the difference between the two dates, divide that by two, then add that to your earliest date.

 

DateTimeAdd([Previous Date],(DateTimeDiff([Next Date],[Previous Date],"days"))/2,"days")

 

date.JPG

DataMeister
7 - Meteor

Thanks to KCGreen for solving the same problem for me! Now it's time for Alteryx developers to make this as easy as Excel does it: MEDIAN(Date 1, Date 2) and that's all. 

Labels